Make WordPress Core

Changeset 65249


Ignore:
Timestamp:
11/03/2026 07:56:05 PM (17 hours ago)
Author:
desrosj
Message:

Build/Test Tools: Use PR number for concurrency groups instead of head_ref.

The current standard across all GitHub Actions workflows is to configure concurrency to use the github.head_ref value in the group name for a given PR. Because head_ref only includes the branch name, workflow runs can be inadvertantly cancelled when two PRs are open from different forks with identical branch names.

This switches to using the github.event.pull_request.number instead of github.head_ref to ensure that runs are properly grouped only with runs from the same pull request. A similar change has been made to props-bot.yml, which can be triggered by an issue_comment event. In this case, the github.event.issue.number will be used. In the context of GitHub, issues == pull_requests for the data returned by a number of request types.

Props lancewillett.
See #65845.

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

Legend:

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

    r63782 r65249  
    7676# Cancels all previous workflow runs for pull requests that have not completed.
    7777concurrency:
    78   # The concurrency group contains the workflow name and the branch name for pull requests
     78  # The concurrency group contains the workflow name and the pull request number for pull requests
    7979  # or the commit hash for any other events.
    80   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     80  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    8181  cancel-in-progress: true
    8282
  • trunk/.github/workflows/end-to-end-tests.yml

    r65049 r65249  
    5151# Cancels all previous workflow runs for pull requests that have not completed.
    5252concurrency:
    53   # The concurrency group contains the workflow name and the branch name for pull requests
     53  # The concurrency group contains the workflow name and the pull request number for pull requests
    5454  # or the commit hash for any other events.
    55   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     55  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    5656  cancel-in-progress: true
    5757
  • trunk/.github/workflows/install-testing.yml

    r65191 r65249  
    3838# Cancels all previous workflow runs for pull requests that have not completed.
    3939concurrency:
    40   # The concurrency group contains the workflow name and the branch name for pull requests
     40  # The concurrency group contains the workflow name and the pull request number for pull requests
    4141  # or the commit hash for any other events.
    42   group: ${{ github.workflow }}-${{ inputs.wp-version || github.event_name == 'pull_request' && github.head_ref || github.sha }}
     42  group: ${{ github.workflow }}-${{ inputs.wp-version || github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    4343  cancel-in-progress: true
    4444
  • trunk/.github/workflows/javascript-tests.yml

    r63782 r65249  
    7777# Cancels all previous workflow runs for pull requests that have not completed.
    7878concurrency:
    79   # The concurrency group contains the workflow name and the branch name for pull requests
     79  # The concurrency group contains the workflow name and the pull request number for pull requests
    8080  # or the commit hash for any other events.
    81   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     81  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    8282  cancel-in-progress: true
    8383
  • trunk/.github/workflows/javascript-type-checking.yml

    r63782 r65249  
    3232# Cancels all previous workflow runs for pull requests that have not completed.
    3333concurrency:
    34   # The concurrency group contains the workflow name and the branch name for pull requests
     34  # The concurrency group contains the workflow name and the pull request number for pull requests
    3535  # or the commit hash for any other events.
    36   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     36  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    3737  cancel-in-progress: true
    3838
  • trunk/.github/workflows/local-docker-environment.yml

    r63782 r65249  
    6565# Cancels all previous workflow runs for pull requests that have not completed.
    6666concurrency:
    67   # The concurrency group contains the workflow name and the branch name for pull requests
     67  # The concurrency group contains the workflow name and the pull request number for pull requests
    6868  # or the commit hash for any other events.
    69   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     69  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    7070  cancel-in-progress: true
    7171
  • trunk/.github/workflows/performance.yml

    r64990 r65249  
    5252# Cancels all previous workflow runs for pull requests that have not completed.
    5353concurrency:
    54   # The concurrency group contains the workflow name and the branch name for pull requests
     54  # The concurrency group contains the workflow name and the pull request number for pull requests
    5555  # or the commit hash for any other events.
    56   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     56  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    5757  cancel-in-progress: true
    5858
  • trunk/.github/workflows/php-compatibility.yml

    r63519 r65249  
    6565# Cancels all previous workflow runs for pull requests that have not completed.
    6666concurrency:
    67   # The concurrency group contains the workflow name and the branch name for pull requests
     67  # The concurrency group contains the workflow name and the pull request number for pull requests
    6868  # or the commit hash for any other events.
    69   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     69  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    7070  cancel-in-progress: true
    7171
  • trunk/.github/workflows/phpstan-static-analysis.yml

    r63396 r65249  
    2727# Cancels all previous workflow runs for pull requests that have not completed.
    2828concurrency:
    29   # The concurrency group contains the workflow name and the branch name for pull requests
     29  # The concurrency group contains the workflow name and the pull request number for pull requests
    3030  # or the commit hash for any other events.
    31   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     31  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    3232  cancel-in-progress: true
    3333
  • trunk/.github/workflows/phpunit-tests.yml

    r63782 r65249  
    7575# Cancels all previous workflow runs for pull requests that have not completed.
    7676concurrency:
    77   # The concurrency group contains the workflow name and the branch name for pull requests
     77  # The concurrency group contains the workflow name and the pull request number for pull requests
    7878  # or the commit hash for any other events.
    79   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     79  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    8080  cancel-in-progress: true
    8181
  • trunk/.github/workflows/props-bot.yml

    r63583 r65249  
    3232# Cancels all previous workflow runs for pull requests that have not completed.
    3333concurrency:
    34   # The concurrency group contains the workflow name and the branch name for pull requests
     34  # The concurrency group contains the workflow name and the pull request number for pull requests
    3535  # or the commit hash for any other events.
    36   group: ${{ github.workflow }}-${{ contains( fromJSON( '["pull_request_target", "pull_request_review", "pull_request_review_comment"]' ), github.event_name ) && github.head_ref || github.sha }}
     36  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number || github.sha }}
    3737  cancel-in-progress: true
    3838
  • trunk/.github/workflows/pull-request-comments.yml

    r65193 r65249  
    1212# Cancels all previous workflow runs for pull requests that have not completed.
    1313concurrency:
    14   # The concurrency group contains the workflow name and the branch name for pull requests
     14  # The concurrency group contains the workflow name and the pull request number for pull requests
    1515  # or the commit hash for any other events.
    16   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.event_name == 'workflow_dispatch' && github.event.number || github.sha }}
     16  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.event.pull_request.number || github.event_name == 'workflow_dispatch' && github.event.number || github.sha }}
    1717
    1818# Disable permissions for all available scopes by default.
  • trunk/.github/workflows/test-and-zip-default-themes.yml

    r65194 r65249  
    7171# Cancels all previous workflow runs for pull requests that have not completed.
    7272concurrency:
    73   # The concurrency group contains the workflow name and the branch name for pull requests
     73  # The concurrency group contains the workflow name and the pull request number for pull requests
    7474  # or the commit hash for any other events, plus the selected branch and theme.
    75   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}-${{ inputs.branch }}-${{ inputs.theme }}
     75  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}-${{ inputs.branch }}-${{ inputs.theme }}
    7676  cancel-in-progress: true
    7777
  • trunk/.github/workflows/test-build-processes.yml

    r63782 r65249  
    5151# Cancels all previous workflow runs for pull requests that have not completed.
    5252concurrency:
    53   # The concurrency group contains the workflow name and the branch name for pull requests
     53  # The concurrency group contains the workflow name and the pull request number for pull requests
    5454  # or the commit hash for any other events.
    55   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     55  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    5656  cancel-in-progress: true
    5757
  • trunk/.github/workflows/test-coverage.yml

    r63782 r65249  
    3939# Cancels all previous workflow runs for pull requests that have not completed.
    4040concurrency:
    41   # The concurrency group contains the workflow name and the branch name for pull requests
     41  # The concurrency group contains the workflow name and the pull request number for pull requests
    4242  # or the commit hash for any other events.
    43   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     43  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    4444  cancel-in-progress: true
    4545
  • trunk/.github/workflows/upgrade-develop-testing.yml

    r64990 r65249  
    4040# Cancels all previous workflow runs for pull requests that have not completed.
    4141concurrency:
    42   # The concurrency group contains the workflow name and the branch name for pull requests
     42  # The concurrency group contains the workflow name and the pull request number for pull requests
    4343  # or the commit hash for any other events.
    44   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     44  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    4545  cancel-in-progress: true
    4646
  • trunk/.github/workflows/upgrade-testing.yml

    r65005 r65249  
    3232# Cancels all previous workflow runs for pull requests that have not completed.
    3333concurrency:
    34   # The concurrency group contains the workflow name and the branch name for pull requests
     34  # The concurrency group contains the workflow name and the pull request number for pull requests
    3535  # or the commit hash for any other events.
    36   group: ${{ github.workflow }}-${{ inputs.new-version || github.event_name == 'pull_request' && github.head_ref || github.sha }}
     36  group: ${{ github.workflow }}-${{ inputs.new-version || github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    3737  cancel-in-progress: true
    3838
  • trunk/.github/workflows/workflow-lint.yml

    r63517 r65249  
    2323# Cancels all previous workflow runs for pull requests that have not completed.
    2424concurrency:
    25   # The concurrency group contains the workflow name and the branch name for pull requests
     25  # The concurrency group contains the workflow name and the pull request number for pull requests
    2626  # or the commit hash for any other events.
    27   group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     27  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
    2828  cancel-in-progress: true
    2929
Note: See TracChangeset for help on using the changeset viewer.