From dcbb4b17c88ce45ce9aa4047378799bbfa8ef271 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 5 Nov 2026 17:15:30 -0500 Subject: [PATCH] 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. Merges [65249] to the 5.9 branch. Props lancewillett. See #65845. --- .github/workflows/coding-standards.yml | 4 ++-- .github/workflows/end-to-end-tests.yml | 4 ++-- .github/workflows/javascript-tests.yml | 4 ++-- .github/workflows/php-compatibility.yml | 4 ++-- .github/workflows/phpunit-tests.yml | 4 ++-- .github/workflows/test-build-processes.yml | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 27558283d74ff..6b53dc7e62c25 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -31,9 +31,9 @@ on: # Cancels all previous workflow runs for pull requests that have not completed. concurrency: - # The concurrency group contains the workflow name and the branch name for pull requests + # The concurrency group contains the workflow name and the pull request number for pull requests # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }} cancel-in-progress: true # Disable permissions for all available scopes by default. diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index c16be231577b9..28d2491945d06 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -16,9 +16,9 @@ on: # Cancels all previous workflow runs for pull requests that have not completed. concurrency: - # The concurrency group contains the workflow name and the branch name for pull requests + # The concurrency group contains the workflow name and the pull request number for pull requests # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }} cancel-in-progress: true # Disable permissions for all available scopes by default. diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index 06c9a749ca3ff..42ade73e8ee9c 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -29,9 +29,9 @@ on: # Cancels all previous workflow runs for pull requests that have not completed. concurrency: - # The concurrency group contains the workflow name and the branch name for pull requests + # The concurrency group contains the workflow name and the pull request number for pull requests # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }} cancel-in-progress: true # Disable permissions for all available scopes by default. diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index b4e39508f6216..494d869e1e05b 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -25,9 +25,9 @@ on: # Cancels all previous workflow runs for pull requests that have not completed. concurrency: - # The concurrency group contains the workflow name and the branch name for pull requests + # The concurrency group contains the workflow name and the pull request number for pull requests # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }} cancel-in-progress: true # Disable permissions for all available scopes by default. diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 9bd225ac667e3..99aad04f33955 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -18,9 +18,9 @@ on: # Cancels all previous workflow runs for pull requests that have not completed. concurrency: - # The concurrency group contains the workflow name and the branch name for pull requests + # The concurrency group contains the workflow name and the pull request number for pull requests # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }} cancel-in-progress: true # Disable permissions for all available scopes by default. diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index bd1527c0a7326..799da1069c966 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -25,9 +25,9 @@ on: # Cancels all previous workflow runs for pull requests that have not completed. concurrency: - # The concurrency group contains the workflow name and the branch name for pull requests + # The concurrency group contains the workflow name and the pull request number for pull requests # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }} cancel-in-progress: true # Disable permissions for all available scopes by default.