Skip to content

ci: cancel superseded runs in remaining workflows#767

Open
abnobdoss wants to merge 1 commit into
apache:mainfrom
abnobdoss:ci/cancel-in-progress
Open

ci: cancel superseded runs in remaining workflows#767
abnobdoss wants to merge 1 commit into
apache:mainfrom
abnobdoss:ci/cancel-in-progress

Conversation

@abnobdoss

Copy link
Copy Markdown

What

Add a concurrency block to the five workflows that don't have one — cpp-linter, pre-commit, license_check, zizmor, and codeql:

concurrency:
  group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
  cancel-in-progress: true

Why

The heavier workflows already cancel outdated runs, but these five don't - so pushing again to a PR leaves the old runs going and tying up runners. Grouping on head_ref || sha cancels superseded PR runs while leaving main and scheduled runs untouched.

@zhjwpku zhjwpku left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cpp-linter can be expensive, I'm not sure why we weren't using workflow concurrency for it already. The other four finish in less than a minute, I don't expect much difference there. But, having a consistent setup across all workflows seems worthwhile.

@abnobdoss

Copy link
Copy Markdown
Author

Thank you for the review! I agree the cpp-linter is the one where we'd actually see it invoked. And I figured, as you said, it'd be nice to make them consistent while we're at it.

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.

2 participants