From 5d09b16c45e41ed906aa8436843a806e81747778 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 5 Nov 2026 17:12:55 -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.1 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 d75cc99eaf920..1f11b49ba774b 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 ee60975b39a0d..23d133d3218fd 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 933bfcd5f8313..72bfb7b84b308 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 940b48e25ae0a..64f1fb878e3eb 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 a6aa2bae00803..6328e081eabbf 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 f9c86e7aaefae..d8241a82e13d3 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.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/php-compatibility.yml b/.github/workflows/php-compatibility.yml index 78f23bbcfe76d..326d0bdc7571f 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 352b78e4c8f43..b0835d1405ee8 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 e63281f59af46..ead80dc6e36e0 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -61,9 +61,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 38acc07113c2c..560068a4311a9 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 8dff8e1c1fcce..e6fa950bc497c 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 64f6c63481914..dae4d1f0a8528 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 3a9a8ec6285bf..e3809a972e143 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 d86b62ca79646..1d4a4d853c0f8 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.