Fix no-commit-to-branch
hook failure in CI when merging pull requests
#104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request addresses an issue where the
no-commit-to-branch
pre-commit hook unexpectedly fails in the GitHub Actions when merging a pull request to specific branches that has already passed CI checks.https://github.com/HenryRLee/PokerHandEvaluator/actions/runs/8957810302
The root cause is that the
no-commit-to-branch
pre-commit hook is designed to prevent direct commits to protected branches by developers. However, when the GitHub Actions runs on a pull request merge commit, it also triggers all the pre-commit hooks, includingno-commit-to-branch
.To resolve this, we can skip the
no-commit-to-branch
hook in the GitHub Actions workflow by setting the environment variableSKIP=no-commit-to-branch
. This change has been tested in a forked repository and successfully allows the merge to proceed.Please review and merge this pull request to fix the unexpected behavior of the
no-commit-to-branch
hook during merges in the CI environment.