Make WordPress Core


Ignore:
Timestamp:
11/03/2026 07:56:05 PM (31 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.