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

Add support for committing with no-verify #1875

Closed
wants to merge 1 commit into from

Conversation

becky-sequence
Copy link

No description provided.

@peter-evans
Copy link
Owner

Hi @becky-sequence

Please check this past issue: #935 (comment)

Does this solve your problem?

If not, please can you explain in detail what your use case is, and why git hooks are enabled when you checkout.

@becky-sequence
Copy link
Author

Hi @becky-sequence

Please check this past issue: #935 (comment)

Does this solve your problem?

If not, please can you explain in detail what your use case is, and why git hooks are enabled when you checkout.

Hi @peter-evans

I've tried a few different things here and am still having issues. What I think I actually want to do is disable hooks for both the commit and the push (this PR just addresses the commit step). We have a pre-commit hook that does some linting and then a pre-push hook that runs all our tests. I'd rather turn off these hooks for these automated PRs because if the tests are going to fail I'd prefer to have an open PR with failing tests to give visibility of this. Even if I manually perform a commit and push with the --no-verify option, it seems the action still does another push and then things fall over.

I don't think adding --no-verify is a particular edge case so think it would be a useful addition to this action.

@peter-evans
Copy link
Owner

Hi @becky-sequence

I'd rather turn off these hooks for these automated PRs

Please can you show me your workflow. Feel free to redact anything that might be sensitive. I would like to understand how the hooks are active, because my understanding is that they need to be installed after checkout. If you happen to be using Husky, there is a solution shared here.

I want to understand more about your use case, but my current order of preference to solve this is:

  1. Don't install the hooks after checkout in the first place
  2. If the hooks are automatically enabled by some framework (like Husky), use an option to disable them if it exists.
  3. Just delete the hooks in the workflow after checkout.
    - run: rm -rf .git/hooks

As I explained in this comment, I'm really trying hard to keep the interface for this action to a minimum to stop it becoming bloated and complicated.

@peter-evans
Copy link
Owner

For anyone finding this, there is now a section in the "common issues" doc about it here: https://github.com/peter-evans/create-pull-request/blob/main/docs/common-issues.md#add-a-no-verify-option-to-bypass-git-hooks

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.

None yet

2 participants