wakatime / semver-action

Auto-generate the next semantic version.
MIT License
11 stars 0 forks source link

Fix git commands #12

Closed gandarez closed 3 years ago

gandarez commented 3 years ago

This PR fixes LatestTag and AncestorTag funcs to correctly validate for string empty.

gandarez commented 3 years ago

As we discussed git commands mixes up many result codes and do not always return an error. For example if we run both commands in a clean repository, the first command returns empty but the second returns an error and exits with code 128.

git tag --points-at HEAD --sort -version:creatordate
git describe --tags --abbrev=0

So the last commit I ignored errors for LatestTag and AncestorTag.

gandarez commented 3 years ago

Alright, so we ignore errors completely. Anyway, in case result will be something invalid, it will fail on semver parsing, right?

Yep I think it's a good approach for that scenario.