Skip to content

Commit 81011af

Browse files
authored
fix: auto-merge workflow permissions and PR detection (#50)
1 parent 151c114 commit 81011af

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
name: Auto-merge dependabot PRs
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
types: [opened, synchronize, reopened, ready_for_review]
6-
check_suite:
7-
types: [completed]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
810

911
jobs:
1012
auto-merge:
@@ -13,8 +15,7 @@ jobs:
1315

1416
steps:
1517
- name: Enable auto-merge for dependabot PRs
16-
run: |
17-
gh pr merge --auto --squash --delete-branch "$PR_URL"
18+
run: gh pr merge --auto --squash --delete-branch "${{ github.event.pull_request.number }}"
1819
env:
19-
PR_URL: ${{ github.event.pull_request.html_url }}
20-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
GH_REPO: ${{ github.repository }}

0 commit comments

Comments
 (0)