Skip to content

Commit 4b098ca

Browse files
authored
Merge pull request #788 from CycloneDX/chore/gh-workflow-permissions
chore: GH workflow permissions
2 parents 22cac58 + 065678e commit 4b098ca

4 files changed

Lines changed: 22 additions & 4 deletions

File tree

.github/workflows/deploy_cargo_cyclonedx.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
tags:
66
- 'cargo-cyclonedx-[0-9]+.[0-9]+.[0-9]+*'
77

8+
# see https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
9+
permissions: {}
10+
811
jobs:
912
deploy:
1013
runs-on: ubuntu-latest

.github/workflows/deploy_cyclonedx_bom.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
tags:
66
- 'cyclonedx-bom-[0-9]+.[0-9]+.[0-9]+*'
77

8+
# see https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
9+
permissions: {}
10+
811
jobs:
912
deploy:
1013
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
# title/body based on your changelogs.
1515

1616
name: Release
17-
permissions:
18-
"attestations": "write"
19-
"contents": "write"
20-
"id-token": "write"
17+
18+
# see https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
19+
permissions: {}
2120

2221
# This task will run whenever you push a git tag that looks like a version
2322
# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
@@ -113,6 +112,10 @@ jobs:
113112
env:
114113
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115114
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
115+
permissions:
116+
contents: read
117+
attestations: write # needed for attestation provenance
118+
id-token: write # needed for attestation provenance
116119
steps:
117120
- name: enable windows longpaths
118121
run: |
@@ -178,6 +181,10 @@ jobs:
178181
env:
179182
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
180183
BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json
184+
permissions:
185+
contents: read
186+
attestations: write # needed for attestation provenance
187+
id-token: write # needed for attestation provenance
181188
steps:
182189
- uses: actions/checkout@v4
183190
with:
@@ -227,6 +234,8 @@ jobs:
227234
runs-on: "ubuntu-20.04"
228235
outputs:
229236
val: ${{ steps.host.outputs.manifest }}
237+
permissions:
238+
contents: write # needed for creating GH releases
230239
steps:
231240
- uses: actions/checkout@v4
232241
with:

.github/workflows/rust.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches:
77
- "main"
88

9+
# see https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
10+
permissions: {}
11+
912
jobs:
1013
lint:
1114
name: Linting & Coding Standards

0 commit comments

Comments
 (0)