Skip to content

Commit 4003996

Browse files
author
kiran-garre
committed
Move PR number and branch name to env vars
1 parent 514d034 commit 4003996

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

.github/workflows/docs-generator.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
PR_FILE: "pr-contents.txt"
2020
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2121
GIT_HASH: "latest"
22-
TEST_PR_NUMBER: 2533
22+
PR_NUMBER: 2533
23+
BRANCH_NAME: "docs-update-for-pr-${{ env.PR_NUMBER }}"
2324
permissions:
2425
id-token: write
2526
contents: write
@@ -49,14 +50,14 @@ jobs:
4950
run: bash docs-generation/setup_amazon_q.sh
5051

5152
- name: Generate PR contents file
52-
run: bash docs-generation/read-pr.sh ${{ env.TEST_PR_NUMBER }}
53+
run: bash docs-generation/read-pr.sh
5354

5455
- name: Update docs
5556
run: bash docs-generation/update-docs.sh
5657

5758
- name: Create PR
5859
if: success()
59-
run: bash docs-generation/create-docs-pr.sh ${{ env.TEST_PR_NUMBER }}
60+
run: bash docs-generation/create-docs-pr.sh
6061

6162

6263

docs-generation/create-docs-pr.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#!/bin/bash
22
set -e
33

4-
PR_NUMBER=$1
5-
BRANCH_NAME="docs-update-for-pr-$PR_NUMBER"
6-
74
# Ensure we have changes to merge
85
if [ -z "$(git status --porcelain)" ]; then
96
echo "No changes to commit"

docs-generation/read-pr.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/bash
22
set -e
33

4-
PR_NUMBER=$1
5-
64
# Add PR information
75
echo "====== PR Information ======\n" > $PR_FILE
86
gh pr view $PR_NUMBER --json title,body --jq '"Title: " + .title + "\nDescription: " + .body' >> $PR_FILE

docs-generation/update-docs.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/bash
22
set -e
33

4-
BRANCH_NAME="docs-update-for-pr-$PR_NUMBER"
5-
64
if [ ! -f "$PR_FILE" ]; then
75
echo "PR file not found, aborting"
86
exit 1

0 commit comments

Comments
 (0)