diff --git a/.github/workflows/profile-projects-sync.yml b/.github/workflows/profile-projects-sync.yml index 2567493..75ffa36 100644 --- a/.github/workflows/profile-projects-sync.yml +++ b/.github/workflows/profile-projects-sync.yml @@ -51,3 +51,21 @@ jobs: GH_TOKEN: ${{ github.token }} BRANCH: ${{ needs.sync.outputs.branch }} run: gh workflow run readme-check.yml --repo "$GITHUB_REPOSITORY" --ref "$BRANCH" + + # The sync pull request only changes the generated project table, so it is + # merged automatically once the required README check has passed. + auto-merge: + name: Merge the sync pull request when the README check passes + needs: [sync, start-required-checks] + if: needs.sync.outputs.changed == 'true' && needs.sync.outputs.pull-request != '' + runs-on: ubuntu-24.04 + timeout-minutes: 5 + permissions: + contents: write + pull-requests: write + steps: + - name: Enable auto-merge (squash) + env: + GH_TOKEN: ${{ github.token }} + PR: ${{ needs.sync.outputs.pull-request }} + run: gh pr merge "$PR" --repo "$GITHUB_REPOSITORY" --auto --squash