Skip to content

Commit

Permalink
Merge pull request #1165 from alphagov/sengi/release-tagging-robustness
Browse files Browse the repository at this point in the history
Fetch latest release tag more robustly.
  • Loading branch information
sengi authored Mar 6, 2024
2 parents 19d4b98 + c717685 commit a2327b1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ jobs:
- name: Find latest version tag
id: find-last-tag
run: |
git fetch --tags --deepen=100
last_tag=$(
git ls-remote -q --exit-code --tags --sort=-version:refname origin 'v*' |
head -1 | grep -Eo 'v[0-9]+'
)
last_tag=$(git describe --tags --match "v*" --abbrev=0)
if [ -z "$last_tag" ]; then
echo "No previous tag found."
if [[ ! "$last_tag" =~ ^v[0-9]*$ ]]; then
echo "No valid previous tag found. last_tag=$last_tag"
exit 1
fi
Expand Down

0 comments on commit a2327b1

Please sign in to comment.