Make WordPress Core

Changeset 63183


Ignore:
Timestamp:
08/11/2026 08:13:21 PM (8 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.

Location:
trunk/.github/workflows
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/coding-standards.yml

    r63167 r63183  
    5151    permissions:
    5252      contents: read
    53     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     53    if: |
     54      github.repository == 'WordPress/wordpress-develop' || (
     55        github.event_name == 'pull_request' && (
     56          ! github.event.repository.private ||
     57          ! github.event.pull_request.draft ||
     58          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     59        )
     60      )
    5461
    5562  # Runs the JavaScript coding standards checks.
     
    5966    permissions:
    6067      contents: read
    61     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     68    if: |
     69      github.repository == 'WordPress/wordpress-develop' || (
     70        github.event_name == 'pull_request' && (
     71          ! github.event.repository.private ||
     72          ! github.event.pull_request.draft ||
     73          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     74        )
     75      )
    6276
    6377  slack-notifications:
  • trunk/.github/workflows/end-to-end-tests.yml

    r63167 r63183  
    5858    permissions:
    5959      contents: read
    60     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     60    if: |
     61      github.repository == 'WordPress/wordpress-develop' || (
     62        github.event_name == 'pull_request' && (
     63          ! github.event.repository.private ||
     64          ! github.event.pull_request.draft ||
     65          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     66        )
     67      )
    6168    strategy:
    6269      fail-fast: false
  • trunk/.github/workflows/javascript-tests.yml

    r63167 r63183  
    5454    permissions:
    5555      contents: read
    56     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     56    if: |
     57      github.repository == 'WordPress/wordpress-develop' || (
     58        github.event_name == 'pull_request' && (
     59          ! github.event.repository.private ||
     60          ! github.event.pull_request.draft ||
     61          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     62        )
     63      )
    5764
    5865  slack-notifications:
  • trunk/.github/workflows/javascript-type-checking.yml

    r63167 r63183  
    4747    permissions:
    4848      contents: read
    49     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     49    if: |
     50      github.repository == 'WordPress/wordpress-develop' || (
     51        github.event_name == 'pull_request' && (
     52          ! github.event.repository.private ||
     53          ! github.event.pull_request.draft ||
     54          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     55        )
     56      )
    5057
    5158  slack-notifications:
  • trunk/.github/workflows/performance.yml

    r63167 r63183  
    5151    name: Determine Matrix
    5252    runs-on: ubuntu-24.04
    53     if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) && ! contains( github.event.before, '00000000' ) }}
     53    if: |
     54      (
     55        github.repository == 'WordPress/wordpress-develop' || (
     56          github.event_name == 'pull_request' && (
     57            ! github.event.repository.private ||
     58            ! github.event.pull_request.draft ||
     59            contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     60          )
     61        )
     62      ) &&
     63      ! contains( github.event.before, '00000000' )
    5464    permissions:
    5565      actions: read
  • trunk/.github/workflows/php-compatibility.yml

    r63167 r63183  
    4343    permissions:
    4444      contents: read
    45     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     45    if: |
     46      github.repository == 'WordPress/wordpress-develop' || (
     47        github.event_name == 'pull_request' && (
     48          ! github.event.repository.private ||
     49          ! github.event.pull_request.draft ||
     50          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     51        )
     52      )
    4653
    4754  slack-notifications:
  • trunk/.github/workflows/phpstan-static-analysis.yml

    r63167 r63183  
    4343    permissions:
    4444      contents: read
    45     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     45    if: |
     46      github.repository == 'WordPress/wordpress-develop' || (
     47        github.event_name == 'pull_request' && (
     48          ! github.event.repository.private ||
     49          ! github.event.pull_request.draft ||
     50          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     51        )
     52      )
    4653
    4754  slack-notifications:
  • 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
  • trunk/.github/workflows/test-and-zip-default-themes.yml

    r62742 r63183  
    7070      contents: read
    7171    timeout-minutes: 10
    72     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     72    if: |
     73      github.repository == 'WordPress/wordpress-develop' || (
     74        github.event_name == 'pull_request' && (
     75          ! github.event.repository.private ||
     76          ! github.event.pull_request.draft ||
     77          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     78        )
     79      )
    7380    strategy:
    7481      fail-fast: false
     
    120127      contents: read
    121128    timeout-minutes: 10
    122     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     129    if: |
     130      github.repository == 'WordPress/wordpress-develop' || (
     131        github.event_name == 'pull_request' && (
     132          ! github.event.repository.private ||
     133          ! github.event.pull_request.draft ||
     134          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     135        )
     136      )
    123137    strategy:
    124138      fail-fast: false
  • trunk/.github/workflows/test-build-processes.yml

    r63167 r63183  
    5252    permissions:
    5353      contents: read
    54     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     54    if: |
     55      github.repository == 'WordPress/wordpress-develop' || (
     56        github.event_name == 'pull_request' && (
     57          ! github.event.repository.private ||
     58          ! github.event.pull_request.draft ||
     59          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     60        )
     61      )
    5562    strategy:
    5663      fail-fast: false
  • trunk/.github/workflows/upgrade-develop-testing.yml

    r63167 r63183  
    4444  build:
    4545    name: Build
    46     uses: WordPress/wordpress-develop/.github/workflows/reusable-build-package.yml@trunk
    47     if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
     46    uses: ./.github/workflows/reusable-build-package.yml
     47    if: |
     48      startsWith( github.repository, 'WordPress/' ) && (
     49        github.repository == 'WordPress/wordpress-develop' || (
     50          github.event_name == 'pull_request' && (
     51            ! github.event.repository.private ||
     52            ! github.event.pull_request.draft ||
     53            contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     54          )
     55        )
     56      )
    4857    permissions:
    4958      contents: read
     
    8796  upgrade-tests-develop-forks:
    8897    name: Upgrade from ${{ matrix.wp }}
    89     uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk
    90     if: ${{ github.repository != 'WordPress/wordpress-develop' }}
     98    uses: ./.github/workflows/reusable-upgrade-testing.yml
     99    # This job also runs for the push event, which has no draft state to check.
     100    if: |
     101      github.repository != 'WordPress/wordpress-develop' && (
     102        github.event_name != 'pull_request' ||
     103        ! github.event.repository.private ||
     104        ! github.event.pull_request.draft ||
     105        contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     106      )
    91107    needs: [ build ]
    92108    permissions:
  • trunk/.github/workflows/workflow-lint.yml

    r63167 r63183  
    3333  lint:
    3434    name: Lint GitHub Action files
    35     uses: WordPress/wordpress-develop/.github/workflows/reusable-workflow-lint.yml@trunk
    36     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     35    uses: ./.github/workflows/reusable-workflow-lint.yml
     36    if: |
     37      github.repository == 'WordPress/wordpress-develop' || (
     38        github.event_name == 'pull_request' && (
     39          ! github.event.repository.private ||
     40          ! github.event.pull_request.draft ||
     41          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     42        )
     43      )
    3744    permissions:
    3845      security-events: write
Note: See TracChangeset for help on using the changeset viewer.