From ac4865bd3aaa21fe2dd8360f614d272787d45689 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 12:05:31 +0000 Subject: [PATCH] Fix setup-actionlint stale version handling Compare installed actionlint version against ACTIONLINT_VERSION and reinstall when the binary is stale or non-executable, instead of treating any existing file as valid. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Makefile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c42abf30..4d63946f 100644 --- a/Makefile +++ b/Makefile @@ -215,9 +215,19 @@ setup-actionlint: @mkdir -p bin @ACTIONLINT_VERSION="$(ACTIONLINT_VERSION)"; \ ACTIONLINT_BIN="bin/actionlint"; \ - if [ -f "$$ACTIONLINT_BIN" ]; then \ - echo "✓ actionlint already installed: $$($$ACTIONLINT_BIN --version 2>&1 | head -1)"; \ - else \ + INSTALL_ACTIONLINT=1; \ + if [ -x "$$ACTIONLINT_BIN" ]; then \ + INSTALLED_VERSION="$$($$ACTIONLINT_BIN --version 2>&1 | head -1 | grep -oE 'v?[0-9]+\.[0-9]+\.[0-9]+' | head -1 | sed 's/^v//')"; \ + if [ "$$INSTALLED_VERSION" = "$$ACTIONLINT_VERSION" ]; then \ + echo "✓ actionlint already installed: $$($$ACTIONLINT_BIN --version 2>&1 | head -1)"; \ + INSTALL_ACTIONLINT=0; \ + else \ + echo "actionlint version mismatch (have: $$($$ACTIONLINT_BIN --version 2>&1 | head -1), want: v$$ACTIONLINT_VERSION). Reinstalling..."; \ + fi; \ + elif [ -f "$$ACTIONLINT_BIN" ]; then \ + echo "actionlint binary exists but is not executable. Reinstalling..."; \ + fi; \ + if [ "$$INSTALL_ACTIONLINT" -eq 1 ]; then \ echo "Downloading actionlint v$$ACTIONLINT_VERSION..."; \ $(DETECT_OS_ARCH); \ URL="https://github.com/rhysd/actionlint/releases/download/v$$ACTIONLINT_VERSION/actionlint_$${ACTIONLINT_VERSION}_$${OS}_$${ARCH}.tar.gz"; \