Commit 61be878
Scope GitHub App tokens to repo and minimum permissions
Each token-minting step now requests only the permissions the job
actually exercises and restricts the token to the current repository.
Plan:
repositories: current repo
permission-contents: read (gh release list in Resolve-Version)
permission-pull-requests: write (label/comment via Get-PSModuleSettings)
Publish-Module:
repositories: current repo
permission-contents: write (gh release create/upload/delete)
permission-pull-requests: write (gh pr comment)
Build-Module:
repositories: current repo
(no permission-* needed - only gh repo view which uses metadata:read,
auto-granted to all GitHub App installations)
This limits blast radius: even if a compromised step obtained GH_TOKEN,
it could only act on the one repository and only with the declared
permission level, not on every repo in the installation.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent 3b4410a commit 61be878
3 files changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
0 commit comments