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 concurrent CI runs for branches other than main #300

Merged
merged 3 commits into from
Aug 12, 2023

Conversation

kscharan
Copy link
Contributor

@kscharan kscharan commented Jul 26, 2023

Closes #298

Copy link
Owner

@gussmith23 gussmith23 left a comment

Choose a reason for hiding this comment

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

See comment! Thank you so much!

@@ -18,6 +18,11 @@ env:
# Can't use ${{ env.REGISTRY }} here, but would like to, so that we' don't
# repeat ghcr.io.
IMAGE_TAG: ghcr.io/${{ github.repository }}:sha-${{ github.sha }}

concurrency:
# Cancel in-progress runs for branches other than main
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think this comment is exactly correct. This doesn't necessarily ignore the main branch. It just uses a different group ID if the branch is main (it uses run_id if the branch is main). This basically means that this workflow won't get canceled for pushes to main, which is fine for our purposes.

Can you add a reference to the source where you took the code from?
https://www.meziantou.net/how-to-cancel-github-workflows-when-pushing-new-commits-on-a-branch.htm

Thank you!

Copy link
Owner

Choose a reason for hiding this comment

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

To be clear, please:

  • Update the comment to reflect what the concurrency group actually does
  • Add a reference to the link

@kscharan
Copy link
Contributor Author

Hello @gussmith23 ,
I have changed the approach. Can you please re-review it?

@kscharan kscharan requested a review from gussmith23 July 28, 2023 21:21
@gussmith23 gussmith23 merged commit b8f5482 into gussmith23:main Aug 12, 2023
2 of 3 checks passed
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.

Cancel concurrent CI runs
2 participants