From 77129545f63b100a274629e5023ce7f3b04323ed Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Wed, 3 Jun 2026 12:22:27 +0200 Subject: [PATCH] fix: handle the use of latest tag alias correctly Fixes fallback curl release resolution when the gh CLI is missing or fails. --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 3b5e14e..ab4bd53 100644 --- a/action.yml +++ b/action.yml @@ -101,7 +101,7 @@ runs: TAG=$(gh release view --repo "${{ inputs.repo }}" --json tagName -q .tagName || true) fi # Fallback to public GitHub API - if [ -z "$TAG" ]; then + if [ -z "$TAG" ] || [ "$TAG" = "latest" ]; then AUTH=() if [ -n "${GH_TOKEN:-}" ]; then AUTH=(-H "Authorization: token $GH_TOKEN") @@ -109,7 +109,7 @@ runs: TAG=$(curl -sSL "${AUTH[@]}" "https://api.github.com/repos/${{ inputs.repo }}/releases/latest" | jq -r '.tag_name // empty' || true) fi # Fail if we still couldn't resolve the latest tag - if [ -z "$TAG" ] || [ "$TAG" = "null" ]; then + if [ -z "$TAG" ] || [ "$TAG" = "latest" ] || [ "$TAG" = "null" ]; then echo "::error::Could not resolve latest release tag for ${{ inputs.repo }}" exit 1 fi