From 81ee17f8e5163c58a0dfd1742473d4bf17431bb9 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Tue, 16 Jul 2024 09:28:55 -0400 Subject: [PATCH] Auto-merge docs PRs on release (#5101) Based on: https://github.com/PrefectHQ/docs/blob/dbebcecf4e0f25dca426eec11f56d5dff3cbbee6/.github/workflows/build-docs.yaml#L334C1-L341C11 --- .github/workflows/publish-docs.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index de1ee32b9..13558f3fc 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -81,7 +81,7 @@ jobs: if: ${{ env.MKDOCS_INSIDERS_SSH_KEY_EXISTS != 'true' }} run: mkdocs build --strict -f mkdocs.public.yml - - name: "Clone repo" + - name: "Clone docs repo" run: | version="${{ env.version }}" git clone https://${{ secrets.ASTRAL_DOCS_PAT }}@github.com/astral-sh/docs.git astral-docs @@ -127,3 +127,16 @@ jobs: --title "$pull_request_title" \ --body "Automated documentation update for $display_name" \ --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