-
Notifications
You must be signed in to change notification settings - Fork 123
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
Run the no-commit-to-branch
check only locally
#2913
Conversation
I got confused by "It does not make sense to run it when merging to main." as almost every PR is aiming to be merged into main. But as gh runs action after it is merged then OK to disable it. BTW summary and PR doesn't match - this PR disables whole pre-commit, not just one hook, right? Is there a way to disable just this check? |
Hm, don't know if it's possible to only disable a specific check. @thrix, any hint?
Ah, right, will update the title if we keep it as it is. |
@psss An attempt to disable single hook. The SKIP for pre-commit is documented at https://pre-commit.com/#temporarily-disabling-hooks Checking event - https://docs.github.com/en/actions/learn-github-actions/contexts#example-usage-of-the-github-context |
Interestingly, in the Artemis project, |
Hmmm, that's really weird.
Great! Thanks for preparing this. Tried with 8366c74 and confirm it works nicely! Let's approve and merge soon! |
7b634aa
to
055aa25
Compare
Nope, no idea why it works in Artemis and fails here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick question - why not add it directly to the workflow env:
key?
no-commit-to-branch
check for pull requests onlyno-commit-to-branch
check only locally
Yeah, now that the condition was dropped this can be simplified. Updated. |
It does not make sense to run this `pre-commit` check in pull requests or when merging to the `main` branch on GitHub. Also update actions to the latest versions to get rid of warnings.
Also updated to the latest versions of actions to get rid of the warnings. |
It does not make sense to run this
pre-commit
check in pull requests or when merging to themain
branch on GitHub. Also update actions to the latest versions to get rid of warnings.