-
-
Notifications
You must be signed in to change notification settings - Fork 655
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
pre-commit prevent commits to protected branches #16970
Conversation
WalkthroughThe recent update introduces a new pre-commit hook to the configuration, which prevents commits to critical branches like Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant Git
participant Pre-commit Hook
Developer->>Git: Attempts to commit changes
Git->>Pre-commit Hook: Triggers pre-commit hooks
Pre-commit Hook->>Pre-commit Hook: Checks branch against protected branches
alt If branch is protected
Pre-commit Hook-->>Git: Reject commit
Git-->>Developer: Notify commit failure
else If branch is not protected
Pre-commit Hook-->>Git: Allow commit
Git-->>Developer: Confirm commit success
end
Recent review detailsConfiguration used: .coderabbit.yml Files selected for processing (1)
Additional comments not posted (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
See test results for failed build of commit 5fe8e59075 |
Link to issue number:
None
Summary of the issue:
To help ensure NV Access admins do not accidentally commit and push to master, we can add a pre-commit check to protect branches from local commits.
This would also aid other developers in preventing local commits to branches they cannot/shouldn't push to in their own forks accidentally, if they wish to contribute upstream.
Description of user facing changes
Add pre-commit hook which fails when trying to commit to a protected branch
Description of development approach
Add pre-commit hook which fails when trying to commit to a protected branch
Testing strategy:
Test committing to master after merging the branch locally
Known issues with pull request:
None
Code Review Checklist:
Summary by CodeRabbit
New Features
master
,beta
, andrc
), enhancing branch protection.Chores