restechnica / semverbot

A CLI which automates semver versioning.
Mozilla Public License 2.0
136 stars 7 forks source link

Is there an option to require to be on a specific branch when creating release #48

Open vidhill opened 1 year ago

vidhill commented 1 year ago

Is there an option to require to be on a specific branch when creating a release?

For example I would like to be able to configure so that, It would require that a user would only be able to make releases from the main/master branch

Thanks, great tool!

vidhill commented 1 year ago

If this feature does not exist I may have the time to add it

ToneVDB commented 1 year ago

Hi @vidhill AFAIK this does not exist, and is usualy configured in some sort of CI/CD pipeline. However as an extra security measure, this might be good for some use cases. @shiouen What do you think?

vidhill commented 1 year ago

Is it something that you would like as a feature.

I wouldn't want to go off and do an implementation and PR,

if it's not a feature you would like

senare commented 1 year ago

I am going chime in with a random thought here, stop me if I talk nonsens !

Would it be possible to have this set as yet-another-mode ? i.e if your project is following git-flow (master/develop) or git-hub-flow (master)

depending on what model you subscribe to you should cut hotfix from master and bugfix from develop .. etc ..etc ..

... there is ofc also the issue with if you call master main or vice-versa ...

ToneVDB commented 1 year ago

Isn't this something you best configure in some sort of CICD pipeline? Lets say on Jenkins you have a trigger on master/develop/... that automatically does the release for you?

We could implement it as some optional configuration as a "fail safe" you can introduce o people dont manually and easyly can release from a different branch, but appart from that i cant seem to find the extra value?

Please do let me know if i misunderstood the usecase ;)

vidhill commented 1 year ago

The use case here is when you would be using semverbot outside of CICD, so I would be running the sbot command locally manually

shiouen commented 1 year ago

Hi @vidhill AFAIK this does not exist, and is usualy configured in some sort of CI/CD pipeline. However as an extra security measure, this might be good for some use cases. @shiouen What do you think?

Definitely an option, could be configured with a flag and/or option. I am a bit low on time unfortunately - anyone have the time to contribute?

vidhill commented 1 year ago

I could give it a go myself, I'm just unsure when I will have some time