Skip to content

Commit cb85c10

Browse files
authored
Merge pull request #3880 from dopplershift/fix-dependabot-merge
Use app token for Dependabot auto-merge
2 parents c5a85d0 + 827e356 commit cb85c10

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/automerge-dependabot.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ jobs:
99
# Automatically review dependabot PRs and set them to automerge (on successful checks)
1010
#
1111
Automerge:
12+
environment:
13+
name: PR Backport
1214
runs-on: ubuntu-latest
1315
if: github.actor == 'dependabot[bot]'
1416
env:
15-
GH_TOKEN: ${{ github.token }}
1617
GH_REPO: ${{ github.repository }}
1718
GH_PR: ${{ github.event.pull_request.number }}
1819

@@ -21,7 +22,19 @@ jobs:
2122
pull-requests: write
2223

2324
steps:
25+
- name: Create App Token
26+
uses: actions/create-github-app-token@v2
27+
id: app-token
28+
with:
29+
app-id: ${{ vars.APP_ID }}
30+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
31+
2432
- name: Set auto-merge
33+
env:
34+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
2535
run: gh pr merge -R "$GH_REPO" --merge --auto "$GH_PR"
36+
2637
- name: Review PR
27-
run: gh pr review -R "$GH_REPO" --approve "$GH_PR"
38+
env:
39+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
40+
run: gh pr review -R "$GH_REPO" --approve "$GH_PR"

0 commit comments

Comments
 (0)