Skip to content

Conversation

@quark17
Copy link
Collaborator

@quark17 quark17 commented Dec 20, 2025

MacOS runners are limited, so I'd like to avoid unnecessary workflow runs. When people push changes to a PR, they may not manually cancel previous CI runs that are in-progress. This PR instructs GitHub to automatically cancel in-progress workflows for the same PR number. For pushes, I'd like to preserve each run, so that we can see which commit failed -- also, when people push to their fork, we don't want to automatically cancel, and instead leave that up to the user to decide.

I was unsure on the best way to express this. GitHub's documentation gave the following example:

concurrency:
  group: ${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

But head_ref is only the branch name, not the user name and branch name, so it would clash if users had the same branch name. Seemed easiest to use the PR number. Documentation on available fields is here.

@quark17
Copy link
Collaborator Author

quark17 commented Dec 20, 2025

I just confirmed that pushing changes caused the previous workflow to cancel, with the following message for each job:

Canceling since a higher priority waiting request for CI-866 exists

while in my own fork, the workflow for the previous push has not been cancelled.

@quark17 quark17 merged commit 329d58c into B-Lang-org:main Dec 20, 2025
78 of 79 checks passed
@quark17 quark17 deleted the cancel-in-progress branch December 20, 2025 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant