From 2be8a1ed9269d0f7bb4559b3436f3c992f5aea05 Mon Sep 17 00:00:00 2001 From: Urmzd Mukhammadnaim Date: Sun, 29 Mar 2026 20:24:38 -0500 Subject: [PATCH] fix: download binary from floating tag instead of latest release The action downloaded its binary from releases/latest/download which breaks when a non-versioned release (e.g. Marketplace) is marked as Latest. Now derives the floating major version tag from the action ref and downloads from that specific release instead. --- action.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index bea6894..17893ae 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,6 @@ name: "embed-src" description: "A GitHub Action that embeds source files into any text file." +author: "urmzd" branding: icon: "file" color: "gray-dark" @@ -66,7 +67,15 @@ runs: esac BINARY_NAME="embed-src-${TARGET}" - DOWNLOAD_URL="https://github.com/urmzd/embed-src/releases/latest/download/${BINARY_NAME}" + # Derive the major version tag from this action's ref (e.g. v3.4.0 -> v3) + # Falls back to "latest" if the ref isn't a semver tag. + ACTION_REF="${GITHUB_ACTION_REF:-latest}" + if [[ "$ACTION_REF" =~ ^v([0-9]+) ]]; then + FLOAT_TAG="v${BASH_REMATCH[1]}" + else + FLOAT_TAG="latest" + fi + DOWNLOAD_URL="https://github.com/urmzd/embed-src/releases/download/${FLOAT_TAG}/${BINARY_NAME}" INSTALL_DIR="$HOME/.local/bin" mkdir -p "$INSTALL_DIR"