Skip to content

Commit a4e54df

Browse files
authored
[Chore] Update API docs workflow (#14345)
* update docs workflow * split code up to separate steps
1 parent 11972e2 commit a4e54df

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/workflows/callable-docs-update.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,22 @@ jobs:
4848
run: |
4949
yarn run docs:references
5050
51+
- name: Prepare docs temp branch
52+
working-directory: ./docs
53+
env:
54+
TEMP_BRANCH_NAME: ${{ needs.docs-update-prep.outputs.branch_name }}
55+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_AMPLIFY_JS_WRITE }}
56+
run: |
57+
# First sync pre-prod/main with main using the "theirs" strategy to resolve conflicts
58+
git fetch origin main pre-prod/main
59+
git checkout pre-prod/main
60+
# Use -X theirs to automatically resolve conflicts in favor of main
61+
git merge origin/main --no-edit -X theirs
62+
git push origin pre-prod/main
63+
64+
# Now create a new branch from the updated pre-prod/main
65+
git checkout -b $TEMP_BRANCH_NAME
66+
5167
- name: Update API references in the docs site
5268
working-directory: ./docs
5369
run: |
@@ -61,6 +77,7 @@ jobs:
6177
TEMP_BRANCH_NAME: ${{ needs.docs-update-prep.outputs.branch_name }}
6278
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_AMPLIFY_JS_WRITE }}
6379
run: |
64-
git checkout -b $TEMP_BRANCH_NAME
6580
git push origin $TEMP_BRANCH_NAME
81+
82+
# Create PR from the temp branch to pre-prod/main
6683
gh pr create -B pre-prod/main -H $TEMP_BRANCH_NAME --title 'chore: amplify-js api references update' --body 'Merge the api references changes from the most recent release.'

0 commit comments

Comments
 (0)