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/javascript-tests.yml

    r55152 r55715  
    3939  cancel-in-progress: true
    4040
     41# Disable permissions for all available scopes by default.
     42# Any needed permissions should be configured at the job level.
     43permissions: {}
     44
    4145jobs:
    4246  # Runs the QUnit tests for WordPress.
     
    5256    name: QUnit Tests
    5357    runs-on: ubuntu-latest
     58    permissions:
     59      contents: read
    5460    timeout-minutes: 20
    5561    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     
    97103    name: Failed workflow tasks
    98104    runs-on: ubuntu-latest
     105    permissions:
     106      actions: write
    99107    needs: [ test-js, slack-notifications ]
    100108    if: |
Note: See TracChangeset for help on using the changeset viewer.