Skip to content

Commit

Permalink
Merge main into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
greenbonebot committed Jun 8, 2023
2 parents 3ff4a71 + 51ecdbd commit cb2d001
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions is-latest-tag/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,30 @@ runs:
- name: "set is-latest-tag"
id: latest
run: |
# find the latest version that is not ourself
export LATEST_VERSION=$(git tag -l | grep -v '${{ github.ref_name }}' | sort -r --version-sort)
if [ "${{ github.ref_type }}" = "tag" ]; then
# find the latest version that is not ourself
export LATEST_VERSION=$(git tag -l | grep -v '${{ github.ref_name }}' | sort -r --version-sort)
# get major minor patch versions
IFS='.' read -r latest_major latest_minor latest_patch << EOF
$LATEST_VERSION
EOF
# get major minor patch versions
IFS='.' read -r latest_major latest_minor latest_patch << EOF
$LATEST_VERSION
EOF
IFS='.' read -r tag_major tag_minor tag_patch << EOF
${{ github.ref_name }}
EOF
IFS='.' read -r tag_major tag_minor tag_patch << EOF
${{ github.ref_name }}
EOF
# remove leading v
latest_major=$(echo $latest_major | cut -c2-)
tag_major=$(echo $tag_major | cut -c2-)
# remove leading v
latest_major=$(echo $latest_major | cut -c2-)
tag_major=$(echo $tag_major | cut -c2-)
echo "$tag_major >= $latest_major"
if [[ $tag_major -ge $latest_major && ($tag_minor -ne 0 || $tag_patch -ne 0) ]]; then
echo "is-latest-tag=true" >> $GITHUB_OUTPUT
echo "$tag_major >= $latest_major"
if [[ $tag_major -ge $latest_major && ($tag_minor -ne 0 || $tag_patch -ne 0) ]]; then
echo "is-latest-tag=true" >> $GITHUB_OUTPUT
else
echo "is-latest-tag=false" >> $GITHUB_OUTPUT
fi
else
echo "is-latest-tag=false" >> $GITHUB_OUTPUT
fi
shell: bash

0 comments on commit cb2d001

Please sign in to comment.