Skip to content
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

Cancel outdated workflow runs. #15206

Merged
merged 2 commits into from
Jun 4, 2021
Merged

Conversation

mshima
Copy link
Member

@mshima mshima commented Jun 3, 2021

Related to #15205 and #14566.

Using group name as worflowName-${{ github.head_ref || (github.ref == 'refs/heads/main' && github.sha) || github.ref }}.
PRs should resolve as worflowName-refs/heads/branchName
Push events to main should resolve as worflowName-commitHash, so will not cancel running workflows.
Push events to others branches should resolve as worflowName-refs/heads/branchName.


Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (bellow reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@mshima
Copy link
Member Author

mshima commented Jun 3, 2021

I will try to enable for branches others than main later.
Is working great for PRs.

@deepu105
Copy link
Member

deepu105 commented Jun 3, 2021

@mshima I dont get your comment in PR description, on newer commits it should cancel older workflows right? even running ones as the new commit is what matters

@mshima
Copy link
Member Author

mshima commented Jun 3, 2021

If we merge 5 PRs at once like we always do, only the last will complete. If that one fails, we will have to manually run every other PR merged at the same time.
@deepu105 IMO a push to main must always complete the workflows, so we don't need to bisect after.

As it is now, this PR cancels every push/pr outdated workflows runs except a push to main branch.

@deepu105
Copy link
Member

deepu105 commented Jun 3, 2021

Yes agree for main but for PR builds I think the last commit would be enough and all others can cancel even if running

@mshima
Copy link
Member Author

mshima commented Jun 3, 2021

It will cancel every push/PRs except push to main.

@mshima mshima changed the title Use concurrency github actions feature. Cancel outdated workflow runs. Jun 3, 2021
@deepu105 deepu105 merged commit 3b7a5a1 into jhipster:main Jun 4, 2021
@pascalgrimaud pascalgrimaud added this to the 7.1.0 milestone Jun 11, 2021
@mshima mshima deleted the skip_ci-concurrency branch June 19, 2021 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants