Skip to content

Commit

Permalink
Supressing error if no tags on the repository but we're trying to get…
Browse files Browse the repository at this point in the history
… non-semver tag (#18)
  • Loading branch information
sbx0r authored Feb 16, 2022
1 parent 182ef78 commit f312a19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ latest_tag=''

if [ "${INPUT_SEMVER_ONLY}" = 'false' ]; then
# Get a actual latest tag.
latest_tag=$(git describe --abbrev=0 --tags)
# If no tags found, supress an error. In such case stderr will be not stored in latest_tag variable so no additional logic is needed.
latest_tag=$(git describe --abbrev=0 --tags || true)
else
# Get a latest tag in the shape of semver.
for ref in $(git for-each-ref --sort=-creatordate --format '%(refname)' refs/tags); do
Expand Down

0 comments on commit f312a19

Please sign in to comment.