question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Support git push options

See original GitHub issue

Problem

My team has a bit of an interesting versioning setup in GitLab CI/CD where we:

  1. Don’t want to run a pipeline on the version bump commit on a development branch
  2. 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:

  1. omit the [skip ci] string from the commit message template
  2. configure @semantic-release/git to use the ci.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:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pvdlgcommented, Nov 28, 2019

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.

0reactions
flavalcommented, Feb 16, 2021

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 with semantic-release, in fact semantic-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 option skip or skipCi which can take values between message, push-option or false, with the message 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 custom message 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Push Options - GitLab Documentation
Push options for merge requests ; merge_request.remove_source_branch, Set the merge request to remove the source branch when it's merged. 12.2 ; merge_request.
Read more >
Feature request: support the --push-option flag : IDEA-202210
Our deployment system uses push options to pass to a Git Hook, which then sends commands to various servers (determined by the "options"...
Read more >
git-push Documentation - Git
git -push - Update remote refs along with associated objects ... When no --push-option=<option> is given from the command line, the values of...
Read more >
Git push options - GitKraken User Suggestions
As a user, I would like to create arbitrary sets of push options that I can then choose to send when I click...
Read more >
Git Push | Atlassian Git Tutorial
Git prevents you from overwriting the central repository's history by refusing push requests when they result in a non-fast-forward merge. So, if the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found