actions / typescript-action

Create a TypeScript Action with tests, linting, workflow, publishing, and versioning
https://github.com/actions
MIT License
2k stars 473 forks source link

Release script fails if no latest release tag exists #937

Open WIStudent opened 1 month ago

WIStudent commented 1 month ago

I ran into the issue that the release script fails after step 6. Tag a new release if no latest release tag exists:

fatal: No names found, cannot describe anything.
No tags found (yet) - Continue to create and push your first tag
The latest release tag is: [unknown]
Enter a new release tag (vX.X.X format): v1.0.0
Tag: v1.0.0 is valid syntax
Make sure the version field in package.json is v1.0.0. Yes? [Y/n] y
Tagged: v1.0.0

This seems to be caused by

# 7. Set 'is_major_release' variable
latest_major_release_tag=$(expr "$latest_tag" : "$major_semver_tag_regex")

which fails with exit code 1 if latest_tag contains [unknown].