Skip to content

Commit e6cc1f5

Browse files
committed
Limit GitHub App token permissions in workflows
Request contents: write for all create-github-app-token call sites because the generated token is used for checkout and for writing repository refs. Also request pull-requests: write in the version bump workflows because the same token is passed to peter-evans/create-pull-request to open release PRs. The tag workflows only create or push Git tags, so contents: write is enough there.
1 parent 304099c commit e6cc1f5

5 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/bump-version-flutter-app.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
with:
3535
client-id: ${{ secrets.APP_ID }}
3636
private-key: ${{ secrets.APP_PRIVATE_KEY }}
37+
permission-contents: write
38+
permission-pull-requests: write
3739

3840
- name: Checkout source code
3941
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

.github/workflows/bump-version-flutter-lib.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
with:
3939
client-id: ${{ secrets.APP_ID }}
4040
private-key: ${{ secrets.APP_PRIVATE_KEY }}
41+
permission-contents: write
42+
permission-pull-requests: write
4143

4244
- name: Checkout source code
4345
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

.github/workflows/bump-version-rust.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ jobs:
4949
with:
5050
client-id: ${{ secrets.APP_ID }}
5151
private-key: ${{ secrets.APP_PRIVATE_KEY }}
52+
permission-contents: write
53+
permission-pull-requests: write
5254

5355
- name: Checkout source code
5456
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

.github/workflows/tag-if-missing.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
with:
2727
client-id: ${{ secrets.APP_ID }}
2828
private-key: ${{ secrets.APP_PRIVATE_KEY }}
29+
permission-contents: write
2930

3031
- name: Checkout source code
3132
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

.github/workflows/tag-untagged-releases-rust.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
with:
2828
client-id: ${{ secrets.APP_ID }}
2929
private-key: ${{ secrets.APP_PRIVATE_KEY }}
30+
permission-contents: write
3031

3132
- name: Checkout source code
3233
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

0 commit comments

Comments
 (0)