Skip to content

Commit 894b855

Browse files
authored
ci: restrict GH token permissions (#394)
Previously, the repository enabled the write permission by default (upstream still does so). We shouldn't do this and only enable write permissions if necessary. This is a step in that direction. The permissions could be scoped a bit more granular in the installer workflow. Since I plan to release a nightly installer and portable after this release, I'll wait with that.
1 parent afe9891 commit 894b855

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,8 @@ jobs:
460460
needs: [build-ubuntu-docker, build-flatpak, build]
461461
runs-on: ubuntu-latest
462462
if: (github.event_name == 'push' && github.ref == 'refs/heads/chatterino7')
463+
permissions:
464+
contents: write # create release
463465

464466
steps:
465467
- uses: actions/checkout@v6

.github/workflows/create-installer.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
env:
2727
# same as in build.yml
2828
C2_ARCH: ${{ case(endsWith(matrix.os, '-arm'), 'arm', 'x86-64') }}
29+
permissions:
30+
# FIXME: this only needed for the nightly upload step (should split to another job)
31+
contents: write
2932
steps:
3033
- uses: actions/checkout@v6
3134
with:
@@ -112,6 +115,9 @@ jobs:
112115
draft-release:
113116
runs-on: ubuntu-latest
114117
needs: [create-installer, check-release]
118+
permissions:
119+
# FIXME: this only needed for the last step (should split to another job)
120+
contents: write
115121
steps:
116122
- uses: actions/checkout@v4
117123
with:

.github/workflows/post-clang-tidy-review.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
# Only when a build succeeds
1414
if: ${{ github.event.workflow_run.conclusion == 'success' }}
15+
permissions:
16+
pull-requests: write
1517

1618
steps:
1719
- uses: ZedThree/clang-tidy-review/post@v0.23.0

0 commit comments

Comments
 (0)