Skip to content

Commit f268633

Browse files
committed
Grant GitHub Actions workflows access to OIDC token
In #3909, new steps were added to the GitHub Actions workflows that upload the build artifacts to a new S3 bucket. Authentication is done using short-lived tokens that are provisioned using OIDC. This scheme requires additional permissions[^1], which have been granted to the workflows. [^1]: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings
1 parent 9bb58a0 commit f268633

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

.github/workflows/ci.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ jobs:
2424
if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} # skip-master skip-stable
2525
env:
2626
RUSTFLAGS: -Ctarget-feature=+crt-static
27+
permissions:
28+
id-token: write
29+
contents: read
2730
strategy:
2831
fail-fast: false
2932
matrix:
@@ -178,6 +181,9 @@ jobs:
178181
if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event_name == 'schedule' }} # skip-pr skip-stable
179182
env:
180183
RUSTFLAGS: -Ctarget-feature=+crt-static
184+
permissions:
185+
id-token: write
186+
contents: read
181187
strategy:
182188
fail-fast: false
183189
matrix:
@@ -332,6 +338,9 @@ jobs:
332338
if: ${{ github.event_name == 'push' && github.ref_name == 'stable' }} # skip-pr skip-master
333339
env:
334340
RUSTFLAGS: -Ctarget-feature=+crt-static
341+
permissions:
342+
id-token: write
343+
contents: read
335344
strategy:
336345
fail-fast: false
337346
matrix:
@@ -490,6 +499,9 @@ jobs:
490499
build-linux-pr: # job-name skip-master skip-stable
491500
runs-on: ubuntu-latest
492501
if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} # skip-master skip-stable
502+
permissions:
503+
id-token: write
504+
contents: read
493505
strategy:
494506
fail-fast: false
495507
matrix:
@@ -646,6 +658,9 @@ jobs:
646658
build-linux-master: # job-name skip-pr skip-stable
647659
runs-on: ubuntu-latest
648660
if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event_name == 'schedule' }} # skip-pr skip-stable
661+
permissions:
662+
id-token: write
663+
contents: read
649664
strategy:
650665
fail-fast: false
651666
matrix:
@@ -807,6 +822,9 @@ jobs:
807822
build-linux-stable: # job-name skip-master skip-pr
808823
runs-on: ubuntu-latest
809824
if: ${{ github.event_name == 'push' && github.ref_name == 'stable' }} # skip-pr skip-master
825+
permissions:
826+
id-token: write
827+
contents: read
810828
strategy:
811829
fail-fast: false
812830
matrix:
@@ -990,6 +1008,9 @@ jobs:
9901008
runs-on: macos-13 # skip-aarch64
9911009
env: # skip-aarch64
9921010
MACOSX_DEPLOYMENT_TARGET: 10.12 # skip-aarch64
1011+
permissions:
1012+
id-token: write
1013+
contents: read
9931014
strategy:
9941015
matrix:
9951016
mode:
@@ -1118,6 +1139,9 @@ jobs:
11181139
runs-on: macos-latest # skip-x86_64
11191140
env: # skip-x86_64
11201141
MACOSX_DEPLOYMENT_TARGET: 11.0 # skip-x86_64
1142+
permissions:
1143+
id-token: write
1144+
contents: read
11211145
strategy:
11221146
matrix:
11231147
mode:

ci/actions-templates/linux-builds-template.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ jobs: # skip-master skip-pr skip-stable
99
if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} # skip-master skip-stable
1010
if: ${{ (github.event_name == 'push' && github.ref_name == 'master') || github.event_name == 'schedule' }} # skip-pr skip-stable
1111
if: ${{ github.event_name == 'push' && github.ref_name == 'stable' }} # skip-pr skip-master
12+
permissions:
13+
id-token: write
14+
contents: read
1215
strategy:
1316
fail-fast: false
1417
matrix:

ci/actions-templates/macos-builds-template.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ jobs: # skip-x86_64 skip-aarch64
1010
runs-on: macos-13 # skip-aarch64
1111
env: # skip-aarch64
1212
MACOSX_DEPLOYMENT_TARGET: 10.12 # skip-aarch64
13+
permissions:
14+
id-token: write
15+
contents: read
1316
strategy:
1417
matrix:
1518
mode:

ci/actions-templates/windows-builds-template.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ jobs: # skip-master skip-pr skip-stable
1111
if: ${{ github.event_name == 'push' && github.ref_name == 'stable' }} # skip-pr skip-master
1212
env:
1313
RUSTFLAGS: -Ctarget-feature=+crt-static
14+
permissions:
15+
id-token: write
16+
contents: read
1417
strategy:
1518
fail-fast: false
1619
matrix:

0 commit comments

Comments
 (0)