Skip to content

Fix rerun-workflow-run concurrency to prevent cross-PR cancellation#18693

Merged
harupy merged 2 commits intomasterfrom
copilot/update-concurrency-group-branch
Nov 5, 2025
Merged

Fix rerun-workflow-run concurrency to prevent cross-PR cancellation#18693
harupy merged 2 commits intomasterfrom
copilot/update-concurrency-group-branch

Conversation

Copy link
Contributor

Copilot AI commented Nov 5, 2025

In workflow_run events, ${{ github.ref }} always evaluates to refs/heads/master, causing simultaneous PR approvals to cancel each other's reruns (e.g., https://github.com/mlflow/mlflow/actions/runs/19103802025/attempts/1).

Changes

  • Replace ${{ github.ref }} with ${{ github.event.workflow_run.head_branch }} in the concurrency group configuration

This ensures each PR's rerun operates in its own concurrency group based on the actual head branch:

concurrency:
  group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.workflow_run.head_branch }}
  cancel-in-progress: true
Original prompt

.github/workflows/rerun-workflow-run.yml has the following concurrency configuration:

concurrency:
  group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
  cancel-in-progress: true

We notice ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} always evaluates to rerun-workflow-run-workflow_run-refs/heads/master. This means if two users approve different PRs simultaneously, the second user's rerun cancels the first user's rerun (example: https://github.com/mlflow/mlflow/actions/runs/19103802025/attempts/1). To avoid this, ${{ github.ref }} needs to be replaced with ${{ github.event.workflow_run.head_branch }} so that the concurrency group is unique per branch.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@harupy harupy marked this pull request as ready for review November 5, 2025 14:24
@harupy harupy added the rn/none List under Small Changes in Changelogs. label Nov 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

@Copilot Thank you for the contribution! Could you fix the following issue(s)?

⚠ Invalid PR template

This PR does not appear to have been filed using the MLflow PR template. Please copy the PR template from here and fill it out.

Replace github.ref with github.event.workflow_run.head_branch in the
concurrency configuration to ensure each PR's rerun has a unique
concurrency group, preventing simultaneous PR approvals from canceling
each other's reruns.

Signed-off-by: GitHub Copilot <noreply@github.com>

Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Copilot AI changed the title [WIP] Update concurrency group for rerun workflow Fix rerun-workflow-run concurrency to prevent cross-PR cancellation Nov 5, 2025
Copilot AI requested a review from harupy November 5, 2025 14:33
@harupy harupy merged commit a6f99b2 into master Nov 5, 2025
56 of 74 checks passed
@harupy harupy deleted the copilot/update-concurrency-group-branch branch November 5, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rn/none List under Small Changes in Changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants