Skip to content

Commit 188225c

Browse files
authored
fix(ci): scope tokens (#169)
1 parent bfda2e0 commit 188225c

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/digestabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
with:
3636
app-id: "${{ secrets.EDERA_CULTIVATION_APP_ID }}"
3737
private-key: "${{ secrets.EDERA_CULTIVATION_APP_PRIVATE_KEY }}"
38+
# Scope to what digestabot needs: push the update branch (contents)
39+
# and open the PR (pull-requests).
40+
permission-contents: write
41+
permission-pull-requests: write
3842

3943
- uses: chainguard-dev/digestabot@33d0b78e580aa0c83fe188eb3dfad6611b662479 # a110b65f3d4742d56b5b2b2306de6e2e54306724
4044
with:

.github/workflows/markdown-lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
with:
3333
app-id: "${{ secrets.EDERA_CULTIVATION_APP_ID }}"
3434
private-key: "${{ secrets.EDERA_CULTIVATION_APP_PRIVATE_KEY }}"
35+
# Scope to only what reviewdog's github-pr-review reporter needs:
36+
# posting review comments on the PR.
37+
permission-pull-requests: write
3538

3639
- name: markdownlint
3740
uses: step-security/action-markdownlint@7eff996c965b6b4a8575f7971d970fc40479c321

.github/workflows/release-artifacts.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ jobs:
183183
with:
184184
app-id: "${{ secrets.EDERA_CULTIVATION_APP_ID }}"
185185
private-key: "${{ secrets.EDERA_CULTIVATION_APP_PRIVATE_KEY }}"
186+
# Scope to what `gh release upload` needs: write release assets.
187+
permission-contents: write
186188

187189
- name: 'Upload release artifacts with retry'
188190
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0

.github/workflows/release.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ jobs:
4040
with:
4141
app-id: "${{ secrets.EDERA_CULTIVATION_APP_ID }}"
4242
private-key: "${{ secrets.EDERA_CULTIVATION_APP_PRIVATE_KEY }}"
43+
# Scope to what release-plz's `release` command needs: create tags
44+
# and GitHub releases.
45+
permission-contents: write
4346

4447
- name: Run release-plz
4548
uses: release-plz/action@e8792575c7f2366cf6ff3ccc33ead9ace5b691c7 # v0.5
@@ -81,6 +84,10 @@ jobs:
8184
with:
8285
app-id: "${{ secrets.EDERA_CULTIVATION_APP_ID }}"
8386
private-key: "${{ secrets.EDERA_CULTIVATION_APP_PRIVATE_KEY }}"
87+
# Scope to what release-plz's `release-pr` command needs: push the
88+
# release branch (contents) and open/update the PR (pull-requests).
89+
permission-contents: write
90+
permission-pull-requests: write
8491

8592
- name: Run release-plz
8693
uses: release-plz/action@e8792575c7f2366cf6ff3ccc33ead9ace5b691c7 # v0.5

0 commit comments

Comments
 (0)