Skip to content

Commit 64c803f

Browse files
committed
Auto merge of #10816 - turrisxyz:Pinned-Dependencies-GitHub, r=epage
chore: Set permissions for GitHub actions Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much. - Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs [Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) Signed-off-by: naveen <[email protected]>
2 parents 2aa12cb + a4ac043 commit 64c803f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/contrib.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ on:
44
branches:
55
- master
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
deploy:
12+
permissions:
13+
contents: write # for Git to git push
914
runs-on: ubuntu-latest
1015
steps:
1116
- uses: actions/checkout@v3

.github/workflows/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ defaults:
99
run:
1010
shell: bash
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
# Check Code style quickly by running `rustfmt` over all code
1417
rustfmt:
@@ -149,13 +152,17 @@ jobs:
149152
sh linkcheck.sh --all cargo
150153
151154
success:
155+
permissions:
156+
contents: none
152157
name: bors build finished
153158
needs: [docs, rustfmt, test, resolver, build_std]
154159
runs-on: ubuntu-latest
155160
if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/auto-cargo'"
156161
steps:
157162
- run: echo ok
158163
failure:
164+
permissions:
165+
contents: none
159166
name: bors build finished
160167
needs: [docs, rustfmt, test, resolver, build_std]
161168
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)