Skip to content

Cancel old ongoing workflows #1216

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

Merged
merged 1 commit into from
Jun 21, 2022
Merged

Cancel old ongoing workflows #1216

merged 1 commit into from
Jun 21, 2022

Conversation

RobPasMue
Copy link
Member

These lines of code will basically cancel pre-existing workflows once you upload new changes, and will avoid running unnecessary workflows.

Use case:

  • You commit and push some changes
  • Workflow is triggered
  • You find out a minor typo/change while the workflow is still running
  • You commit and push the typo/change

In these circumstances, it is more than probable that you will have two workflows running on parallel, though you are not interested in the older one. This way, GitHub cancels the old workflow and just retains the new one.

@RobPasMue RobPasMue requested review from akaszynski and germa89 June 21, 2022 08:58
@RobPasMue RobPasMue self-assigned this Jun 21, 2022
@github-actions github-actions bot added CI/CD Related with CICD, Github Actions, etc Maintenance labels Jun 21, 2022
@codecov
Copy link

codecov bot commented Jun 21, 2022

Codecov Report

Merging #1216 (bdb0ef0) into main (3843087) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1216   +/-   ##
=======================================
  Coverage   78.02%   78.02%           
=======================================
  Files          43       43           
  Lines        6777     6777           
=======================================
  Hits         5288     5288           
  Misses       1489     1489           

@RobPasMue
Copy link
Member Author

Looks like CI finally passed (after multiple retries). Ready to be reviewed @germa89 @akaszynski.

Copy link
Collaborator

@germa89 germa89 left a comment

Choose a reason for hiding this comment

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

Very nice addition. Thank you very much @RobPasMue ! Good job!

*I'm leaving this so @akaszynski can merge it. This is very good to be implemented in other projects.

@akaszynski
Copy link
Collaborator

This is very good to be implemented in other projects.

Fully agree. @RobPasMue, please open an issue in the dev-guide and write it down.

@akaszynski akaszynski merged commit d9b0276 into main Jun 21, 2022
@akaszynski akaszynski deleted the feat/cancel-ongoing-runs branch June 21, 2022 17:01
@germa89
Copy link
Collaborator

germa89 commented Jun 22, 2022

@RobPasMue this not affect code static analyzer. I don't think it is a big deal (I wouldn't bother to change that) but I just want to leave paper trace about that.

Otherwise good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD Related with CICD, Github Actions, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants