Skip to content

Commit 27db585

Browse files
author
kiran-garre
committed
Test workflow 4; run on already documented PR
1 parent 806f45d commit 27db585

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

docs-generation/create-docs-pr.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ fi
1313
git config user.name "docs-generator[bot]"
1414
git config user.email "docs-generator[bot]@amazon.com"
1515

16-
# Create branch, pull if needed (for updating existing docs PRs), and push
17-
git checkout -B "$BRANCH_NAME"
18-
if git ls-remote --exit-code --heads origin $BRANCH_NAME; then
19-
git pull origin $BRANCH_NAME
20-
fi
16+
# Push (branch should have already been created in update-docs.sh)
2117
git add docs
2218
git commit -m "Update docs based on PR #$PR_NUMBER
2319

docs-generation/update-docs.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
#!/bin/bash
22
set -e
33

4+
BRANCH_NAME="docs-update-for-pr-$PR_NUMBER"
5+
46
if [ ! -f "$PR_FILE" ]; then
57
echo "PR file not found, aborting"
68
exit 1
79
fi
810

11+
# Create branch before making any changes
12+
git checkout -B "$BRANCH_NAME"
13+
if git ls-remote --exit-code --heads origin $BRANCH_NAME; then
14+
git pull origin $BRANCH_NAME --force
15+
fi
16+
917
PROMPT="Before making any changes, read the 'docs' directory for the project's current
1018
documentation. Then read 'pr-contents.txt' to see the contents of the current PR.\n\n
1119
After reading both the directory and the PR file, update the files in the 'docs' directory
12-
with new, concise documentation reflecting the proposed changes in the PR. Make new files as appropriate."
20+
with new, concise documentation reflecting ONLY the proposed changes in the PR. Make new files as appropriate.
21+
Do not document changes or functionalities not related to the PR."
1322

1423
timeout 10m echo -e $PROMPT | qchat chat --non-interactive --trust-all-tools
1524
exit $?

0 commit comments

Comments
 (0)