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.

Ability to set `commit` to different values in add and version commands.

See original GitHub issue

Affected Packages

@changesets/cli

Problem

We recently migrated to Changesets and are seeing some issues related to the commit option being used by both add and version commands. We set it to true, thinking that it would be convenient if didn’t have to run git add/commit immediately after having run changeset add. But when the action/changesets picks up the changes and runs changeset version, it adds [skip ci] to the commit message and submits the PR. When we merge the PR, nothing happens because CI is skipped.

I looked through the docs and even looked into the code to see if I had missed a configuration somewhere, but it turns out it was removed back in 2.0, with the message below:

  1. If you use commit and skipCI in versionOptions or publishOptions, set commit to true, all commits will include a skip ci message. if you have a use case for only using commit on one command or not including a skip ci message by default, contact us and we will talk about re-implementing these features.

https://github.com/atlassian/changesets/blob/678b16a6e49976bd3884919303bc22ed6690d151/packages/cli/CHANGELOG.md?plain=1#L738

So I guess what I’m asking is if we can re-implement this feature 😄

Proposed solution

Ability to override commit for one command, or at least split up the commit option so we can set different values for add and version commands.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
rohit-gohricommented, Jan 12, 2022

I’ll be interested in an option to disable addition of “[skip ci]” while keeping the auto commit functionality. My usecase is like this:

changeset version runs on CI whenever someone opens a PR from develop (staging env) -> main (prod env) and pushes back the result to develop branch.

Due to the [skip ci] the pipeline gets skipped and the required CI checks in Github Branch protection rules fail image

One solution I think that would fit most use cases is to be able to customize the commit message template itself rather add a specific option for [skip ci]. Something similar to the changelog option?

1reaction
Andaristcommented, Dec 15, 2021

Sadly, this won’t work with all package managers. Yarn deprecated them in 2.0: https://yarnpkg.com/advanced/lifecycle-scripts

Today I Relearned

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ability to set `commit` to different values in add and version ...
We recently migrated to Changesets and are seeing some issues related to the commit option being used by both add and version commands....
Read more >
Git Commit | Atlassian Git Tutorial
The git commit command captures a snapshot of the project's currently staged changes. Committed snapshots can be thought of as “safe” versions of...
Read more >
First steps with git: clone, add, commit, push - Earth Lab
Learn basic git commands, including clone, add, commit, and push.
Read more >
7.1 Git Tools - Revision Selection
This command shows you any commits in your current branch that aren't in the master branch on your origin remote. If you run...
Read more >
How to manage the version number in Git? - Stack Overflow
One solution is that each time I make a commit, I increase the hard-coded version number (which implies to always modify a minimum...
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