-
Notifications
You must be signed in to change notification settings - Fork 53
allow branches #34
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
base: master
Are you sure you want to change the base?
allow branches #34
Conversation
till
commented
Feb 5, 2023
- Chore: upgrade go to 1.19
- Chore: update actions
- Update: allow push to certain branches
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.
Left some comments to share my thoughtprocess.
|
|
||
| env: | ||
| GO_VERSION: 1.18 | ||
| GO_VERSION: 1.19 |
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.
Mostly updated to be able to use some functions and also, newer is better. :D
| return base != hook.OldRev, nil | ||
| } | ||
|
|
||
| func (r *Receiver) CheckAllowedBranch(hook *HookInfo) error { |
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.
Made this public so I could add a test. Otherwise, the code in Handle requires a full blown setup with commits and repositories and so on. Not ideal, but hope it's alright.
|
@sosedoff Can you take a look some time? |
|
Yea will review this week. |
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.
Looking good so far, see my comments and adjust accordingly.
This extends MasterOnly and makes it configurable. The idea is to set arbitrary branch names which are allowed to be pushed to and otherwise return an error. Resolves: sosedoff#33
- renamed AllowedBranches to AllowedRefs - use t.Run() in tests
|
@sosedoff this took me a bit longer than expected, can you have a look again? |
|
@sosedoff any interest in this? |
|
Probably, i haven't used the repo myself in quite a bit so getting up to speed will take some time |
|
@sosedoff should I rebase this so we can merge this? Or should I abandon this effort? |