Skip to content

Commit 992bcfe

Browse files
authored
Scope the Dependabot auto-merge token to least privilege (#12)
1 parent e81741f commit 992bcfe

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/dependabot_merge.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Dependabot auto-merge
22
on: pull_request_target
33

4+
# The minted App token (below) performs the writes; the default token only reads.
45
permissions:
5-
contents: write
6-
pull-requests: write
6+
contents: read
77

88
jobs:
99
dependabot:
@@ -16,6 +16,13 @@ jobs:
1616
with:
1717
client-id: ${{ secrets.MERGE_APP_ID }}
1818
private-key: ${{ secrets.MERGE_APP_KEY }}
19+
# Least privilege: scope the minted token to THIS repo, with only the
20+
# permissions auto-merge needs — not the App's org-wide
21+
# actions/issues write across all repositories.
22+
owner: ${{ github.repository_owner }}
23+
repositories: ${{ github.event.repository.name }}
24+
permission-contents: write
25+
permission-pull-requests: write
1926

2027
- name: Dependabot metadata
2128
id: metadata

0 commit comments

Comments
 (0)