Make WordPress Core


Ignore:
Timestamp:
05/03/2023 10:15:27 PM (17 months 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/php-compatibility.yml

    r55487 r55715  
    3636  cancel-in-progress: true
    3737
     38# Disable permissions for all available scopes by default.
     39# Any needed permissions should be configured at the job level.
     40permissions: {}
     41
    3842jobs:
    3943
     
    5559    name: Check PHP compatibility
    5660    runs-on: ubuntu-latest
     61    permissions:
     62      contents: read
    5763    timeout-minutes: 20
    5864    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     
    122128    name: Failed workflow tasks
    123129    runs-on: ubuntu-latest
     130    permissions:
     131      actions: write
    124132    needs: [ php-compatibility, slack-notifications ]
    125133    if: |
Note: See TracChangeset for help on using the changeset viewer.