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

Fix no-commit-to-branch hook failure in CI when merging pull requests #104

Merged
merged 1 commit into from
May 5, 2024

Conversation

azriel1rf
Copy link
Collaborator

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, including no-commit-to-branch.

To resolve this, we can skip the no-commit-to-branch hook in the GitHub Actions workflow by setting the environment variable SKIP=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.

@azriel1rf azriel1rf self-assigned this May 5, 2024
@azriel1rf azriel1rf requested a review from HenryRLee May 5, 2024 18:12
Copy link
Owner

@HenryRLee HenryRLee left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for fixing it!

@HenryRLee HenryRLee merged commit b2eebdd into develop May 5, 2024
12 checks passed
@azriel1rf azriel1rf deleted the skip_no_commit_to_branch_on_merge branch May 6, 2024 04:35
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.

2 participants