Skip to content

Commit

Permalink
fix: filtered get last version to ignore 'v' pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsonbrsilva committed Apr 25, 2024
1 parent 184bcce commit a20b9c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions actions/latest-version-obtaining/latest-version-obtaining.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

# Fetch tags from remote.
git fetch --unshallow origin --tags > /dev/null 2>&1 || { echo "Failed to fetch tags from remote."; exit 1; }
git fetch origin --tags > /dev/null 2>&1 || { echo "Failed to fetch tags from remote."; exit 1; }

# Get the last repository tag.
last_version=$(git describe --tags --abbrev=0 2>/dev/null)
last_version=$(git tag --sort=version:refname | grep -v '^v' | tail -n 1)

if [ -z "$last_version" ]; then
echo "No found version associated with this branch."
Expand Down

0 comments on commit a20b9c6

Please sign in to comment.