Feature request: Support git push options
See original GitHub issueProblem
My team has a bit of an interesting versioning setup in GitLab CI/CD where we:
- Don’t want to run a pipeline on the version bump commit on a development branch
- Want to run a pipeline on the version bump commit once it makes it into a primary (master) branch
Adding [skip ci]
to every commit means we need to manually run pipelines after merges if the version bump commit is the most recent commit after a merge.
Proposal
GitLab supports a ci.skip option that when combined with this plugin should allow us to achieve both scenarios when we:
- omit the
[skip ci]
string from the commit message template - configure
@semantic-release/git
to use theci.skip
push option
Version commits to our develop branch won’t be built, and merges to our master/production branches will.
This support should still mean that this plugin is CI agnostic as push options is a git feature rather than a GitLab feature and not required at all.
I’m happy to make a PR for this if it sounds like something that this plugin should support. It looks like I’d need to pass through any push options to the push()
method here and here.
Thanks 😄
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:7 (3 by maintainers)
For info we don’t recommend using semantic-release with Git Flow. See https://github.com/semantic-release/semantic-release/issues/1231#issuecomment-534773456
The goal of semantic-release is to continuously deliver. As such any commit that end up on the release branch (master by default) is considered releasable and is released. Gitflow does the exact opposite and “store” commits on a release branch before actually releasing.
I’m sure there is way to force semantic-release to fit in GitFlow, but I wouldn’t recommend it. If you want a tool that only automate some tasks and doesn’t take over the whole release process for you, including the decision to make a release or not, I would suggest to look to other more limited tools doing those specific automation tasks.
I found this issue because my team and I are in the same situation : using this fantastic tool
semantic-release
while we use a “Git Flow-like” workflow pattern and we use fast forward merge only for clearer git history. Although you don’t recommend using Git Flow withsemantic-release
, in factsemantic-release
is quite flexible to be configured with Git Flow pattern.Despite this question, actually in February 2021, do this plugin still support git 2.0.0, so the
--push-option
solution still not conceivable ? I thought to an additional optionskip
orskipCi
which can take values betweenmessage
,push-option
orfalse
, with themessage
default value for avoid breaking change. This solution brings the possibility to avoid the “[skip ci]” string in commit message without have to pass a custommessage
option and copy/paste the default message commit omitting this specific “[skip ci]” letters.I can do a PR for this proposal (I was ready to do it, but in last minute I wanted to check if the solution was not already proposed, and I found this issue 🙂)
I’m sorry for my English, I use and abuse Google Translate to write this comment