Skip to content

Prevent unnecessary CI workflow runs #2196

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

Conversation

wpaulino
Copy link
Contributor

No description provided.

This master branch is just an alias to the main branch for legacy
reasons, so there's no need to run workflows on both branches.
At times, PRs can go through multiple pushes in a short amount of time,
spawning a workflow run for each. Most of the time, there's no need to
let the previous jobs running if the code itself has changed (e.g., via
a force push), and we'd benefit from having those slots be used by other
PRs/branches instead.
@wpaulino wpaulino force-pushed the ci-ignore-master-cancel-prev branch from 7db7232 to d63006d Compare April 17, 2023 18:33
Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

No idea what this does, but we'll see if it works once we merge it. YOLO.

@wpaulino
Copy link
Contributor Author

Heh, feel free to browse through https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions to confirm the behavior here.

Copy link
Contributor

@dunxen dunxen left a comment

Choose a reason for hiding this comment

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

Oh nice! Didn't know there was a cancel-in-progress config.

Comment on lines +4 to +9
push:
branches-ignore:
- master
pull_request:
branches-ignore:
- master
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we mean main here? Also does this mean merges to main won't kick off CI anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we just want to prevent any workflows from running on the master branch. Whether it resulted from a merged PR into main (which is then replayed on master) or from a PR attempting to merge into master (all PRs should go to main) shouldn't matter.

@TheBlueMatt TheBlueMatt merged commit 68149a2 into lightningdevkit:main Apr 17, 2023
@wpaulino wpaulino deleted the ci-ignore-master-cancel-prev branch April 17, 2023 22:01
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