Skip to content

Enable GitHub actions cancel-in-progress for PRs #10799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

iluuu1994
Copy link
Member

Pushing many commits to a pull request in a short amount of time can stall the merge builds and also wastes energy unnecessarily. github.head_ref is only set for pull requests. For the main branches we fall back to github.run_id which is unique and always available.

@iluuu1994 iluuu1994 force-pushed the github-actions-cancel-in-progress branch from 5534706 to 351637e Compare March 6, 2023 22:27
@iluuu1994 iluuu1994 requested a review from TimWolla March 6, 2023 22:28
@iluuu1994
Copy link
Member Author

Unfortunately, notification e-mails on cancel can't be disabled 🙁 community/community#13015

Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

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

The concept LGTM. Consider this an approval if the group name is adjusted.

Pushing many commits to a pull request in a short amount of time can stall the
merge builds and also wastes energy unnecessarily. github.head_ref is only set
for pull requests. For the main branches we fall back to github.run_id which is
unique and always available.
@iluuu1994 iluuu1994 force-pushed the github-actions-cancel-in-progress branch from 09cad40 to d3b8a78 Compare March 6, 2023 22:57
@iluuu1994
Copy link
Member Author

Done and done. Thank you for the review! I will adjust the commit message when merging.

Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

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

I trust you tested the updated definition, so here's your official approval 😄

@iluuu1994 iluuu1994 closed this in cfe1aab Mar 7, 2023
@iluuu1994
Copy link
Member Author

@TimWolla I tested this on my private fork to be sure. I also checked if there's a way to add the merge commit to the same group to cancel the PR pipeline but unfortunately there's no information on the PR in the pipeline triggered by the merge. But this would be a nice to have, usually we wait for the pipeline to finish before merging.

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.

3 participants