File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 3333 if : " ${{ github.event.inputs.current-release-tag == '' }}"
3434 run : echo "CURRENT_TAG=$(git tag --points-at ${{github.sha}} | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(\+|$)' | tail -n 1)" >> "$GITHUB_ENV"
3535
36- - name : ' Set previous Git tag from commit'
37- run : echo "PREVIOUS_TAG=$(git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(\+|$)' | tail -n 2 | head -n 1)" >> "$GITHUB_ENV"
36+ - name : ' Set previous Git tag from local repo (semantic version sort)'
37+ run : |
38+ TAGS=$(git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(\+|$)' | sort -V)
39+ if [ $(echo "$TAGS" | wc -l) -lt 2 ]; then
40+ PREVIOUS_TAG=""
41+ else
42+ PREVIOUS_TAG=$(echo "$TAGS" | tail -n 2 | head -n 1)
43+ fi
44+ echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> "$GITHUB_ENV"
3845
3946 - name : ' Print environment variables'
4047 run : |
You can’t perform that action at this time.
0 commit comments