Skip to content

chore(ci): refactor more workflows to scope permissions #1979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/make-v2-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
# Needed as recommended by npm docs on publishing with provenance https://docs.npmjs.com/generating-provenance-statements
permissions:
id-token: write
contents: write
environment: Release
runs-on: ubuntu-latest
outputs:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/on_doc_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ permissions:
jobs:
release-docs:
permissions:
actions: write
id-token: write
id-token: write # trade JWT token for AWS credentials in AWS Docs account
secrets: inherit
uses: ./.github/workflows/reusable-publish-docs.yml
uses: ./.github/workflows/reusable_publish_docs.yml
with:
version: main
alias: stage
10 changes: 5 additions & 5 deletions .github/workflows/publish_layer.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Deploy layer to all regions

permissions:
id-token: write
contents: write
pages: write

on:
# Manual trigger
Expand Down Expand Up @@ -57,6 +55,8 @@ jobs:
needs:
- build-layer
uses: ./.github/workflows/reusable_deploy_layer_stack.yml
permissions:
id-token: write
with:
stage: "BETA"
artifact-name: "cdk-layer-artifact"
Expand All @@ -69,6 +69,8 @@ jobs:
needs:
- deploy-beta
uses: ./.github/workflows/reusable_deploy_layer_stack.yml
permissions:
id-token: write
with:
stage: "PROD"
artifact-name: "cdk-layer-artifact"
Expand All @@ -95,11 +97,9 @@ jobs:
release-docs:
needs: [ deploy-prod, prepare_docs_alias ]
permissions:
contents: write
pages: write
id-token: write
secrets: inherit
uses: ./.github/workflows/reusable-publish-docs.yml
uses: ./.github/workflows/reusable_publish_docs.yml
with:
version: ${{ inputs.latest_published_version }}
alias: ${{ needs.prepare_docs_alias.outputs.DOCS_ALIAS }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/rebuild_latest_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ permissions:
jobs:
release-docs:
permissions:
actions: write # upload artifacts (for debugging issues with the docs build)
id-token: write # trade JWT token for AWS credentials in AWS Docs account
secrets: inherit
uses: ./.github/workflows/reusable_publish_docs.yml
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/reusable_publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
runs-on: ubuntu-latest
environment: Docs
permissions:
actions: write # upload artifacts (for debugging issues with the docs build)
id-token: write # trade JWT token for AWS credentials in AWS Docs account
steps:
- name: Checkout code
Expand Down