Auto-merge docs PRs on release (#5101)

Based on:
dbebcecf4e/.github/workflows/build-docs.yaml (L334C1-L341C11)
This commit is contained in:
Charlie Marsh 2024-07-16 09:28:55 -04:00 committed by GitHub
parent 2ff3b380b1
commit 81ee17f8e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -81,7 +81,7 @@ jobs:
if: ${{ env.MKDOCS_INSIDERS_SSH_KEY_EXISTS != 'true' }} if: ${{ env.MKDOCS_INSIDERS_SSH_KEY_EXISTS != 'true' }}
run: mkdocs build --strict -f mkdocs.public.yml run: mkdocs build --strict -f mkdocs.public.yml
- name: "Clone repo" - name: "Clone docs repo"
run: | run: |
version="${{ env.version }}" version="${{ env.version }}"
git clone https://${{ secrets.ASTRAL_DOCS_PAT }}@github.com/astral-sh/docs.git astral-docs git clone https://${{ secrets.ASTRAL_DOCS_PAT }}@github.com/astral-sh/docs.git astral-docs
@ -127,3 +127,16 @@ jobs:
--title "$pull_request_title" \ --title "$pull_request_title" \
--body "Automated documentation update for $display_name" \ --body "Automated documentation update for $display_name" \
--label "documentation" --label "documentation"
- name: "Merge Pull Request"
if: ${{ inputs.plan != '' && !fromJson(inputs.plan).announcement_tag_is_implicit }}
working-directory: astral-docs
env:
GITHUB_TOKEN: ${{ secrets.ASTRAL_DOCS_PAT }}
run: |
branch_name="${{ env.branch_name }}"
# auto-merge the PR if the build was triggered by a release. Manual builds should be reviewed by a human.
# give the PR a few seconds to be created before trying to auto-merge it
sleep 10
gh pr merge --squash $branch_name