Skip to content

Commit

Permalink
fix(ci/automerge): use PAT token
Browse files Browse the repository at this point in the history
- GitHub does not allow ordinary GITHUB_TOKEN to trigger other
  workflows, probably to avoid endless recursion
- using PAT might fix this

Signed-off-by: AtomicFS <[email protected]>
  • Loading branch information
AtomicFS authored and AtomicFS committed Nov 18, 2024
1 parent 5e01648 commit b93f169
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"acpica",
"addinivalue",
"addoption",
"automerge",
"autopep",
"blkio",
"bsdmainutils",
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/bot--automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions: read-all

jobs:
# Enable auto-merge on all pull requests by default
# Docs: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request
enable-auto-merge:
runs-on: ubuntu-latest
permissions:
Expand All @@ -23,10 +24,11 @@ jobs:
run: |
gh pr merge --auto "${{ github.event.pull_request.number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GH_PAT_AUTOMERGE }}

# If PR is made by dependabot, automatically approve the PR
# Linting and all checks will still have to pass in order for the PR to be merged
# Docs: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#approve-a-pull-request
auto-approve-dependabot:
runs-on: ubuntu-latest
permissions:
Expand All @@ -36,8 +38,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Auto approve dependabot pull requests
if: github.actor == 'dependabot[bot]'
if: ${{ github.actor == 'dependabot[bot]' }}
run: |
gh pr review "${{ github.event.pull_request.number }}" --approve
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GH_PAT_AUTOMERGE }}

0 comments on commit b93f169

Please sign in to comment.