Skip to content

Commit b387926

Browse files
authored
chore(ci): refactor more workflows to scope permissions (#1979)
* chore(ci): refactor more workflows to scope permissions * chore(ci): revert change * chore(ci): add scoped id-token
1 parent 9d816ba commit b387926

File tree

5 files changed

+7
-11
lines changed

5 files changed

+7
-11
lines changed

Diff for: .github/workflows/make-v2-release.yml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
# Needed as recommended by npm docs on publishing with provenance https://docs.npmjs.com/generating-provenance-statements
1616
permissions:
1717
id-token: write
18-
contents: write
1918
environment: Release
2019
runs-on: ubuntu-latest
2120
outputs:

Diff for: .github/workflows/on_doc_merge.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ permissions:
1414
jobs:
1515
release-docs:
1616
permissions:
17-
actions: write
18-
id-token: write
17+
id-token: write # trade JWT token for AWS credentials in AWS Docs account
1918
secrets: inherit
20-
uses: ./.github/workflows/reusable-publish-docs.yml
19+
uses: ./.github/workflows/reusable_publish_docs.yml
2120
with:
2221
version: main
2322
alias: stage

Diff for: .github/workflows/publish_layer.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Deploy layer to all regions
22

33
permissions:
4-
id-token: write
54
contents: write
6-
pages: write
75

86
on:
97
# Manual trigger
@@ -57,6 +55,8 @@ jobs:
5755
needs:
5856
- build-layer
5957
uses: ./.github/workflows/reusable_deploy_layer_stack.yml
58+
permissions:
59+
id-token: write
6060
with:
6161
stage: "BETA"
6262
artifact-name: "cdk-layer-artifact"
@@ -69,6 +69,8 @@ jobs:
6969
needs:
7070
- deploy-beta
7171
uses: ./.github/workflows/reusable_deploy_layer_stack.yml
72+
permissions:
73+
id-token: write
7274
with:
7375
stage: "PROD"
7476
artifact-name: "cdk-layer-artifact"
@@ -95,11 +97,9 @@ jobs:
9597
release-docs:
9698
needs: [ deploy-prod, prepare_docs_alias ]
9799
permissions:
98-
contents: write
99-
pages: write
100100
id-token: write
101101
secrets: inherit
102-
uses: ./.github/workflows/reusable-publish-docs.yml
102+
uses: ./.github/workflows/reusable_publish_docs.yml
103103
with:
104104
version: ${{ inputs.latest_published_version }}
105105
alias: ${{ needs.prepare_docs_alias.outputs.DOCS_ALIAS }}

Diff for: .github/workflows/rebuild_latest_docs.yml

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ permissions:
2828
jobs:
2929
release-docs:
3030
permissions:
31-
actions: write # upload artifacts (for debugging issues with the docs build)
3231
id-token: write # trade JWT token for AWS credentials in AWS Docs account
3332
secrets: inherit
3433
uses: ./.github/workflows/reusable_publish_docs.yml

Diff for: .github/workflows/reusable_publish_docs.yml

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ jobs:
4747
runs-on: ubuntu-latest
4848
environment: Docs
4949
permissions:
50-
actions: write # upload artifacts (for debugging issues with the docs build)
5150
id-token: write # trade JWT token for AWS credentials in AWS Docs account
5251
steps:
5352
- name: Checkout code

0 commit comments

Comments
 (0)