From 60c451e74cd98518af773402da20e3d29dfc5c79 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 5 Nov 2026 17:13:06 -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 7.0 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/javascript-type-checking.yml | 4 ++-- .github/workflows/local-docker-environment.yml | 4 ++-- .github/workflows/performance.yml | 4 ++-- .github/workflows/php-compatibility.yml | 4 ++-- .github/workflows/phpstan-static-analysis.yml | 4 ++-- .github/workflows/phpunit-tests.yml | 4 ++-- .github/workflows/props-bot.yml | 4 ++-- .github/workflows/pull-request-comments.yml | 4 ++-- .github/workflows/test-build-processes.yml | 4 ++-- .github/workflows/upgrade-develop-testing.yml | 4 ++-- .github/workflows/workflow-lint.yml | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 56a5961acd741..26a65a2b737e8 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -34,9 +34,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 ca7bed7591e1f..c91af32eeec51 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -37,9 +37,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 a06a37afb3321..15fc0d96b335a 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -37,9 +37,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-type-checking.yml b/.github/workflows/javascript-type-checking.yml index 01422a6d7d7ac..81ed86a8a8ffd 100644 --- a/.github/workflows/javascript-type-checking.yml +++ b/.github/workflows/javascript-type-checking.yml @@ -30,9 +30,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/local-docker-environment.yml b/.github/workflows/local-docker-environment.yml index 1adbaff8d8c8f..089257a00874a 100644 --- a/.github/workflows/local-docker-environment.yml +++ b/.github/workflows/local-docker-environment.yml @@ -60,9 +60,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/performance.yml b/.github/workflows/performance.yml index dc83e2a9d297b..4476a9a344fdf 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -38,9 +38,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 26fd352258b86..c601828f51f1e 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -26,9 +26,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/phpstan-static-analysis.yml b/.github/workflows/phpstan-static-analysis.yml index a9e2c787725e2..536807c5b50a9 100644 --- a/.github/workflows/phpstan-static-analysis.yml +++ b/.github/workflows/phpstan-static-analysis.yml @@ -26,9 +26,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 39942d787f07e..b7e9b36a059cb 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -60,9 +60,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/props-bot.yml b/.github/workflows/props-bot.yml index a8656eb5ce1a9..a84a07af64978 100644 --- a/.github/workflows/props-bot.yml +++ b/.github/workflows/props-bot.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 }}-${{ contains( fromJSON( '["pull_request_target", "pull_request_review", "pull_request_review_comment"]' ), github.event_name ) && github.head_ref || github.sha }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number || github.sha }} cancel-in-progress: true # Disable permissions for all available scopes by default. diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index da30e2feb7f11..e8a648e97f4ba 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -11,9 +11,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_target' && github.head_ref || github.event_name == 'workflow_dispatch' && github.event.number || github.sha }} + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.event.pull_request.number || github.event_name == 'workflow_dispatch' && github.event.number || github.sha }} # Disable permissions for all available scopes by default. # Any needed permissions should be configured at the job level. diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index ef67633d2ff03..26baa5b729f68 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -35,9 +35,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/upgrade-develop-testing.yml b/.github/workflows/upgrade-develop-testing.yml index e09c1049f3674..34cfe761eba90 100644 --- a/.github/workflows/upgrade-develop-testing.yml +++ b/.github/workflows/upgrade-develop-testing.yml @@ -30,9 +30,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/workflow-lint.yml b/.github/workflows/workflow-lint.yml index 774d621151408..8b59d6ba5db25 100644 --- a/.github/workflows/workflow-lint.yml +++ b/.github/workflows/workflow-lint.yml @@ -20,9 +20,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.