diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec1ef041b2068..6693182e0c578 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,11 +25,15 @@ name: CI pull_request: branches: - "**" +permissions: + contents: read defaults: run: shell: bash jobs: pr: + permissions: + actions: write name: PR env: CI_JOB_NAME: "${{ matrix.name }}" @@ -142,6 +146,8 @@ jobs: AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}" if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')" auto: + permissions: + actions: write name: auto env: CI_JOB_NAME: "${{ matrix.name }}" @@ -547,6 +553,8 @@ jobs: AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}" if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')" try: + permissions: + actions: write name: try env: CI_JOB_NAME: "${{ matrix.name }}" diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 7826fd514093e..f020c31079e5e 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -264,6 +264,9 @@ on: branches: - "**" +permissions: + contents: read + defaults: run: # On Linux, macOS, and Windows, use the system-provided bash as the default @@ -273,6 +276,8 @@ defaults: jobs: pr: + permissions: + actions: write # for rust-lang/simpleinfra/github-actions/cancel-outdated-builds <<: *base-ci-job name: PR env: @@ -293,6 +298,8 @@ jobs: <<: *job-linux-xl auto: + permissions: + actions: write # for rust-lang/simpleinfra/github-actions/cancel-outdated-builds <<: *base-ci-job name: auto env: @@ -719,6 +726,8 @@ jobs: <<: *job-windows-xl try: + permissions: + actions: write # for rust-lang/simpleinfra/github-actions/cancel-outdated-builds <<: *base-ci-job name: try env: