Make WordPress Core


Ignore:
Timestamp:
08/11/2026 08:13:21 PM (15 hours ago)
Author:
desrosj
Message:

Build/Test Tools: Skip pull_request triggered runs in private repos.

This modifies the conditions for GitHub Actions workflow runs so that they do not run within private forks and mirrors for pull_request events when the PR is in draft status.

For situations where this may be desirable, a Draft Workflow Runs label can be added to a draft pull request to force workflows to run.

Props desrosj, jorbin.
See #65848.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/phpunit-tests.yml

    r63167 r63183  
    5959    permissions:
    6060      contents: read
    61     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     61    if: |
     62      github.repository == 'WordPress/wordpress-develop' || (
     63        github.event_name == 'pull_request' && (
     64          ! github.event.repository.private ||
     65          ! github.event.pull_request.draft ||
     66          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     67        )
     68      )
    6269
    6370  #
     
    7784      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    7885      WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
    79     if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
     86    if: |
     87      startsWith( github.repository, 'WordPress/' ) && (
     88        github.repository == 'WordPress/wordpress-develop' || (
     89          github.event_name == 'pull_request' && (
     90            ! github.event.repository.private ||
     91            ! github.event.pull_request.draft ||
     92            contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     93          )
     94        )
     95      )
    8096    strategy:
    8197      fail-fast: false
     
    160176      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    161177      WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
    162     if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
     178    if: |
     179      startsWith( github.repository, 'WordPress/' ) && (
     180        github.repository == 'WordPress/wordpress-develop' || (
     181          github.event_name == 'pull_request' && (
     182            ! github.event.repository.private ||
     183            ! github.event.pull_request.draft ||
     184            contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     185          )
     186        )
     187      )
    163188    strategy:
    164189      fail-fast: false
     
    218243      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    219244      WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
    220     if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
     245    if: |
     246      startsWith( github.repository, 'WordPress/' ) && (
     247        github.repository == 'WordPress/wordpress-develop' || (
     248          github.event_name == 'pull_request' && (
     249            ! github.event.repository.private ||
     250            ! github.event.pull_request.draft ||
     251            contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     252          )
     253        )
     254      )
    221255    strategy:
    222256      fail-fast: false
     
    265299      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    266300      WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
    267     if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
     301    if: |
     302      startsWith( github.repository, 'WordPress/' ) && (
     303        github.repository == 'WordPress/wordpress-develop' || (
     304          github.event_name == 'pull_request' && (
     305            ! github.event.repository.private ||
     306            ! github.event.pull_request.draft ||
     307            contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     308          )
     309        )
     310      )
    268311    strategy:
    269312      fail-fast: false
     
    299342      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    300343      WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
    301     if: ${{ ! startsWith( github.repository, 'WordPress/' ) && github.event_name == 'pull_request' }}
     344    if: |
     345      ! startsWith( github.repository, 'WordPress/' ) &&
     346      github.event_name == 'pull_request' && (
     347        ! github.event.repository.private ||
     348        ! github.event.pull_request.draft ||
     349        contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     350      )
    302351    strategy:
    303352      fail-fast: false
Note: See TracChangeset for help on using the changeset viewer.