Skip to content

Commit 29eaa41

Browse files
committed
github: use pr.user.login to determine PR author
Using github.actor to determine if a PR was created by dependabot and autoapprove it can be exploited using a "Confused Deputy" attack. Using github.event.pull_request.user.login instead verifies the actual author of the PR.
1 parent ce517a5 commit 29eaa41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/auto-merge-dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ permissions: write-all
88
jobs:
99
dependabot:
1010
runs-on: ubuntu-latest
11-
if: ${{ github.actor == 'dependabot[bot]' }}
11+
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
1212
steps:
1313
- name: Approve a PR
1414
run: gh pr review --approve "$PR_URL"

0 commit comments

Comments
 (0)