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

Only publish from a specific branch #466

Closed
hewIngram opened this issue Oct 28, 2019 · 4 comments · Fixed by #558
Closed

Only publish from a specific branch #466

hewIngram opened this issue Oct 28, 2019 · 4 comments · Fixed by #558

Comments

@hewIngram
Copy link

hewIngram commented Oct 28, 2019

Github gives you the option to set a different branch as default, on np you can restrict publishing to be only from 'master' but not any other branch. It feels like it'd be nice to restrict publish to be from a specific named branch as well.

Description

Add a config option to allow users to set a different branch name to restrict publishing to. Then, if the --any-branch flag isn't passed, when the 'Check current branch' step runs it should compare the current branch name to the publishing branch in the config.

Is the feature request related to a problem?

We use 'release' as our master branch and I'd like to be able to restrict publishing to just that branch.

Possible implementation

It looks like git.verifyCurrentBranchIsMaster just needs to take the value from config for the comparison. If there is not custom branch set then it defaults to master. Is the config accessible here?

Alternatives

¯\(ツ)

@sindresorhus
Copy link
Owner

Sounds good. PR welcome :)

@chinesedfan
Copy link
Collaborator

@sindresorhus I am afraid that people have not reached an agreement. See #58 (comment). Unless you changed your mind.

@sindresorhus
Copy link
Owner

@chinesedfan #58

@hewIngram
Copy link
Author

-default-branch makes sense alongside --any-branch seems sensible.

Happy to have a look at adding it.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants