-
Notifications
You must be signed in to change notification settings - Fork 127
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
feat: Add support for executing pre-receive hooks #908
base: main
Are you sure you want to change the base?
Conversation
|
✅ Deploy Preview for endearing-brigadeiros-63f9d0 canceled.
|
@06kellyjac (cc) 🍰 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #908 +/- ##
==========================================
+ Coverage 63.20% 64.01% +0.81%
==========================================
Files 47 48 +1
Lines 1685 1723 +38
==========================================
+ Hits 1065 1103 +38
Misses 620 620 ☔ View full report in Codecov by Sentry. |
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.
Another solid G-PR 😏
Can you confirm my understanding? This PR supports the definition and execution of .sh
scripts which can be exposed to the chain via the hooks
folder?
Just a reminder to get the EasyCLA signed and we're good to proceed 🍰 |
Thank you @JamieSlome for the review! |
Thanks for the clarifications and updates ❤️ Once the EasyCLA is signed I'll merge the PR 🍰 EDIT: and release 🚀 |
@JamieSlome I added a check to verify whether the pre-receive hook exists. If it doesn’t, we simply skip its execution without any errors. This way, the check is only enforced if both the hooks folder and the pre-receive file are present. What do you think? Aside from that, we were considering implementing auto-approval of pushes using this hook. I'll create a separate PR for that, but perhaps adding a configuration option like
We are working to get the EasyCLA signed, thanks again!😊 |
This PR adds support for managing pre-receive hooks by executing .sh scripts located in the ./hooks directory. These scripts allow administrators to define conditions for automatically approving or rejecting pushes.
Changes Introduced
You can also test this feature using the following pre-receive samples. Simply place a sample script in the ./hooks directory and attempt a push. The script should execute and determine whether the push is accepted or rejected.