Skip to content

Commit cc580e9

Browse files
authored
Explicit merge-current-pr job (#985)
1 parent 62c02ca commit cc580e9

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

.github/workflows/bump.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,9 @@ jobs:
1717
run: |
1818
git config --global user.name 'HongBot'
1919
git config --global user.email '109153616+hong-bot@users.noreply.github.com'
20-
- name: Merge current PR
21-
if: github.event_name == 'pull_request' && github.triggering_actor == 'hong-bot' # Run this after bump cask PRs are created.
22-
env:
23-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24-
run: |
25-
gh pr merge ${{ github.event.number }} --auto --rebase
2620
- uses: Homebrew/actions/setup-homebrew@main
2721
- name: Bump packages
2822
env:
29-
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GH_TOKEN }} # Different from GITHUB_TOKEN, this is a PAT for hong-bot.
23+
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GH_TOKEN }} # A PAT for hong-bot which will trigger workflows run.
3024
run: |
3125
brew bump --no-fork --open-pr --casks --tap=$GITHUB_REPOSITORY

.github/workflows/check.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,15 @@ jobs:
7979
exit 1
8080
fi
8181
echo "All required jobs completed successfully."
82+
83+
84+
merge-current-pr:
85+
runs-on: ubuntu-slim
86+
needs: final-status
87+
if: github.event_name == 'pull_request' && github.triggering_actor == 'hong-bot' # Run this after bump package PRs are created.
88+
steps:
89+
- name: Merge
90+
env:
91+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token will not trigger workflows run, which is desired here.
92+
run: |
93+
gh pr merge ${{ github.event.number }} --auto --rebase

0 commit comments

Comments
 (0)