Make WordPress Core


Ignore:
Timestamp:
05/03/2023 10:15:27 PM (2 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Restrict the permissions granted to jobs on GitHub Actions

The permissions key in a job declares the GitHub permissions that are granted to the token that's used by the job. Restricting the permissions reduces the impact that a vulnerability in the CI system can have.

Props desrosj, johnbillion

See #57865

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/test-and-zip-default-themes.yml

    r55152 r55715  
    4545  cancel-in-progress: true
    4646
     47# Disable permissions for all available scopes by default.
     48# Any needed permissions should be configured at the job level.
     49permissions: {}
     50
    4751jobs:
    4852  # Tests the build script for themes that have one.
     
    5761    name: Test ${{ matrix.theme }} build script
    5862    runs-on: ubuntu-latest
     63    permissions:
     64      contents: read
    5965    timeout-minutes: 10
    6066    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     
    102108    name: Create ${{ matrix.theme }} ZIP file
    103109    runs-on: ubuntu-latest
     110    permissions:
     111      contents: read
    104112    needs: [ test-build-scripts ]
    105113    timeout-minutes: 10
     
    153161    name: Failed workflow tasks
    154162    runs-on: ubuntu-latest
     163    permissions:
     164      actions: write
    155165    needs: [ test-build-scripts, bundle-theme, slack-notifications ]
    156166    if: |
Note: See TracChangeset for help on using the changeset viewer.