absolute-version / commit-and-tag-version

Fork of the excellent standard-version. Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org :trophy:
ISC License
360 stars 33 forks source link

How to access the release type in life cycle scripts? #150

Open davidsneighbour opened 2 months ago

davidsneighbour commented 2 months ago

I tried looking for something about this in the docs or existing issues, but didn't succeed probably due to me needing to know the right words... I would like to know inside of a lifecycle hook (for instance, prerelease) what kind of release I am creating (patch, minor, major). Is there an environment variable or something I can use to find that out? If not, what would be your approach about this?

As a specific example: In my prerelease script I run a dry-run release to retrieve the changelog. In minor or major releases this leads to wrong version numbers because I have one single prerelease hook that does the dry-run without forcing a version type.