Added a better way to get the last tag
This commit is contained in:
16
action.yml
16
action.yml
@@ -19,14 +19,24 @@ runs:
|
|||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 0 # Include full history with tags
|
|
||||||
- name: Get new version
|
- name: Get new version
|
||||||
run: |
|
run: |
|
||||||
last_version="$(git describe --tags --match "v*" --abbrev=0 || echo "")"
|
git -c 'versionsort.suffix=-' ls-remote --tags -q --refs --sort '-v:refname'
|
||||||
|
|
||||||
|
git -c 'versionsort.suffix=-' ls-remote --tags -q --refs --sort '-v:refname' | head -n 1 | cut -d "/" -f3
|
||||||
|
echo Test
|
||||||
|
first=$(git -c 'versionsort.suffix=-' ls-remote --tags -q --refs --sort '-v:refname')
|
||||||
|
echo $first
|
||||||
|
second=$(echo "$first" | head -n 1)
|
||||||
|
log_info $second
|
||||||
|
third=$(echo "$second" | cut -d "/" -f3)
|
||||||
|
log_info $third
|
||||||
|
last_version="$(git -c 'versionsort.suffix=-' ls-remote --tags -q --refs --sort '-v:refname' | head -n 1 | cut -d "/" -f3 || echo "")"
|
||||||
|
log_info Hello
|
||||||
if [[ -z "$last_version" ]]; then
|
if [[ -z "$last_version" ]]; then
|
||||||
last_version="v0.0.0"
|
last_version="v0.0.0"
|
||||||
fi
|
fi
|
||||||
|
log_info HelloWw
|
||||||
last_version="${last_version:1}"
|
last_version="${last_version:1}"
|
||||||
log_info "Last version: ${last_version}"
|
log_info "Last version: ${last_version}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user