Make WordPress Core

Changeset 65696


Ignore:
Timestamp:
11/19/2026 11:04:19 PM (16 hours ago)
Author:
desrosj
Message:

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

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.

Reviewed by lancewillett.
Merges r63183 to the 7.1 branch.

Props desrosj, jorbin, lancewillett.
See #65848.

Location:
branches/7.1
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/7.1

  • branches/7.1/.github/workflows/coding-standards.yml

    r65493 r65696  
    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:
  • branches/7.1/.github/workflows/end-to-end-tests.yml

    r65493 r65696  
    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
  • branches/7.1/.github/workflows/javascript-tests.yml

    r65493 r65696  
    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:
  • branches/7.1/.github/workflows/javascript-type-checking.yml

    r65493 r65696  
    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:
  • branches/7.1/.github/workflows/performance.yml

    r65493 r65696  
    5151    name: Determine Matrix
    5252    runs-on: ubuntu-26.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
  • branches/7.1/.github/workflows/php-compatibility.yml

    r65493 r65696  
    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:
  • branches/7.1/.github/workflows/phpstan-static-analysis.yml

    r65493 r65696  
    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:
  • branches/7.1/.github/workflows/phpunit-tests.yml

    r65493 r65696  
    7878    permissions:
    7979      contents: read
    80     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     80    if: |
     81      github.repository == 'WordPress/wordpress-develop' || (
     82        github.event_name == 'pull_request' && (
     83          ! github.event.repository.private ||
     84          ! github.event.pull_request.draft ||
     85          contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     86        )
     87      )
    8188
    8289  #
    … …  
    96103      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    97104      WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
    98     if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
     105    if: |
     106      startsWith( github.repository, 'WordPress/' ) && (
     107        github.repository == 'WordPress/wordpress-develop' || (
     108          github.event_name == 'pull_request' && (
     109            ! github.event.repository.private ||
     110            ! github.event.pull_request.draft ||
     111            contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     112          )
     113        )
     114      )
    99115    strategy:
    100116      fail-fast: false
    … …  
    196212      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    197213      WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
    198     if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
     214    if: |
     215      startsWith( github.repository, 'WordPress/' ) && (
     216        github.repository == 'WordPress/wordpress-develop' || (
     217          github.event_name == 'pull_request' && (
     218            ! github.event.repository.private ||
     219            ! github.event.pull_request.draft ||
     220            contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     221          )
     222        )
     223      )
    199224    strategy:
    200225      fail-fast: false
    … …  
    273298      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    274299      WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
    275     if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
     300    if: |
     301      startsWith( github.repository, 'WordPress/' ) && (
     302        github.repository == 'WordPress/wordpress-develop' || (
     303          github.event_name == 'pull_request' && (
     304            ! github.event.repository.private ||
     305            ! github.event.pull_request.draft ||
     306            contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     307          )
     308        )
     309      )
    276310    strategy:
    277311      fail-fast: false
    … …  
    332366      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    333367      WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
    334     if: ${{ startsWith( github.repository, 'WordPress/' ) && ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) }}
     368    if: |
     369      startsWith( github.repository, 'WordPress/' ) && (
     370        github.repository == 'WordPress/wordpress-develop' || (
     371          github.event_name == 'pull_request' && (
     372            ! github.event.repository.private ||
     373            ! github.event.pull_request.draft ||
     374            contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     375          )
     376        )
     377      )
    335378    strategy:
    336379      fail-fast: false
    … …  
    366409      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    367410      WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }}
    368     if: ${{ ! startsWith( github.repository, 'WordPress/' ) && github.event_name == 'pull_request' }}
     411    if: |
     412      ! startsWith( github.repository, 'WordPress/' ) &&
     413      github.event_name == 'pull_request' && (
     414        ! github.event.repository.private ||
     415        ! github.event.pull_request.draft ||
     416        contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
     417      )
    369418    strategy:
    370419      fail-fast: false
  • branches/7.1/.github/workflows/test-build-processes.yml

    r65493 r65696  
    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
  • branches/7.1/.github/workflows/upgrade-develop-testing.yml

    r65493 r65696  
    4545    name: Build
    4646    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' ) }}
     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
    … …  
    8897    name: Upgrade from ${{ matrix.wp }}
    8998    uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk
    90     if: ${{ github.repository != 'WordPress/wordpress-develop' }}
     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:
  • branches/7.1/.github/workflows/workflow-lint.yml

    r65493 r65696  
    3434    name: Lint GitHub Action files
    3535    uses: WordPress/wordpress-develop/.github/workflows/reusable-workflow-lint.yml@trunk
    36     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     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.