Tag Release
Suggest and apply the next semver tag based on commits since the last tag.
Suggest and apply the next semver tag based on commits since the last tag.
Note: For team repos or any repo with a CI/CD pipeline, automated tagging via a pipeline (e.g. GitHub Actions triggered on merge to main) is strongly preferred over running this command manually. Use this command for solo projects or when no pipeline is set up.
Steps:
- Run
git tag --sort=-version:refname | head -1to find the most recent tag. If no tags exist, suggestv0.1.0as the first tag. - Run
git log <last-tag>..HEAD --onelineto see commits since the last tag. If there are no commits since the last tag, tell the user there is nothing to release and stop. - Determine the next semver version:
- Bump major if any commit contains
BREAKING CHANGE - Bump minor if any commit is type
feat - Bump patch for all other changes
- Bump major if any commit contains
- Show the user the proposed tag, the version bump reason, and the list of commits that will be included.
- Ask the user to confirm before proceeding.
- On confirmation, run
git tag <version>to create the tag, thengit push origin <version>to push it. - Confirm the tag was pushed and print the tag name.
$ARGUMENTS