Standard-version: How to update badge version in README.md when I run standard-version?

Created on 6 Jun 2018  路  6Comments  路  Source: conventional-changelog/standard-version

I have README.md:

# proj-name
## proj-title

[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)

And when I run standard-version this version not updated.

Most helpful comment

If it's an npm module you want something like npm version which will track the latest published version.

[![npm version](https://badge.fury.io/js/survey-monkey-streams.svg)](//npmjs.com/package/survey-monkey-streams)

Replace survey-monkey-streams with your module name

Could you link to the project you're working on, for context?

All 6 comments

I think that v1.0.0 is the version of the conventional commits standard that the badge refers to? Not the version of your module.

@aaronjameslang
Ok, thanks. You're right.
I want to update my module version:

# proj-name 
## proj-title

[![version](https://img.shields.io/badge/version-1.0.1-yellow.svg)](https://semver.org)

If it's an npm module you want something like npm version which will track the latest published version.

[![npm version](https://badge.fury.io/js/survey-monkey-streams.svg)](//npmjs.com/package/survey-monkey-streams)

Replace survey-monkey-streams with your module name

Could you link to the project you're working on, for context?

@aaronjameslang
I found a way to update version of badge:
[![GitHub version](https://badge.fury.io/gh/conventional-changelog%2Fstandard-version.svg)](https://badge.fury.io/gh/conventional-changelog%2Fstandard-version)
This badge gets version from github releases.


And also we can use postchangelog lifecycle.
For example:
```
"standard-version": {
"scripts": {
"postchangelog": "cat package.json | grep '\"version\"' > VERSION"
}
}

Great! 馃槃

Will leave this for you to close if it's solved

Well...
My version of module be updated, but repository changes doesn't be commited with the release.

$ git status
On branch master
nothing to commit, working tree clean
$ cat package.json | grep '\"version\"'
  "version": "1.1.4",
$ npm run release
# Also I want to update version of my module in VERSION file
$ git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   VERSION

no changes added to commit (use "git add" and/or "git commit -a")
$ cat package.json | grep '\"version\"'
  "version": "1.1.5",

And I do not want to make a new commit for updating VERSION file.
I think will be correct to make this change with same commit.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

roboto84 picture roboto84  路  3Comments

vidavidorra picture vidavidorra  路  5Comments

SteveVanOpstal picture SteveVanOpstal  路  4Comments

gultyaev picture gultyaev  路  4Comments

kimnh-0823 picture kimnh-0823  路  4Comments