Comments (1)
Apologies for the slow reply.
Yes, this behaviour is expected. When you run the tool, you are asking for a release to be made. If there are no commits that would end up in the changelog, then a release is made incrementing only the patch version.
Personally, this isn't my preferred behaviour - I don't personally want to release if there would be no release notes - because either you missed documenting something in the changelog, or there's nothing that's worth releasing to users.
However, there's currently no option that will allow you to stop a release if there are no changelog changes.
In another project (which used standard-version
before it was forked here), I wrote a bit of bash to do a dry run and check the release notes. You can find it here. The relevant part is:
RELEASE_NOTES="$(npx commit-and-tag-version --dry-run | awk 'BEGIN { flag=0 } /^---$/ { if (flag == 0) { flag=1 } else { flag=2 }; next } flag == 1')"
# Don't release if there are no changes
if [ "$(echo "$RELEASE_NOTES" | wc -l)" -eq 1 ] ; then
error "This release would have no release notes. Does it include changes?"
echo " - You must have at least one fix / feat commit to generate release notes"
echo "*** STOPPING RELEASE PROCESS ***"
exit 1
fi
It works, but it relies on the log output, which is obviously not ideal.
I think a "don't release if no changelog changes" flag would be a good feature to add.
from commit-and-tag-version.
Related Issues (20)
- Unable to use '--bumpFiles' command line arg the same way as the '.versionrc' file HOT 1
- Major bump doesnโt happen until version 1.0.0 HOT 3
- How can I include all types in generated Changelog ? HOT 8
- "commitsSort": false does not work as documented HOT 10
- deprecated warning in deps HOT 5
- how to works with multiple commits HOT 2
- npm run release -- --release-as 1.0.0 as first release ends up with 1.1.0 HOT 5
- [Request] Use .npmrc message key if available HOT 2
- How to include dynamic link to unreleased features in CHANGELOG header HOT 5
- CLI runs successfully even when invalid arguments are passed HOT 2
- How can I have this package run `pnpm i` before committing? HOT 7
- [feat]: provide intellisense for `package.json` configs
- Generate changelog for commit range HOT 1
- Show commits in changelog even if they don't follow format HOT 5
- Version bump insisting on versioning to 1.0.1 in azure-pipeline HOT 6
- Changes between tags with no changes HOT 2
- feat: option to push automatically HOT 3
- Support generating changelog section for Unreleased commits HOT 1
- How to retrieve the generated CHANGELOG part (only the latest changes) in lifecycle scripts HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from commit-and-tag-version.