From c92e524e781aadddcbbf3617072213a3c465694b Mon Sep 17 00:00:00 2001 From: Lena Solarova Date: Thu, 23 Apr 2026 14:32:17 +0200 Subject: [PATCH] fix: skip go-version check when workflow has no go-version field The check was extended to cover gotests.yml (in addition to gotests.yaml) but repos whose workflows use a UBI container instead of setup-go do not declare go-version, causing the check to fail with an empty comparison. Skip gracefully when go-version is not present, consistent with how the check already handles missing workflow files and reusable workflows. Co-Authored-By: Claude Sonnet 4.6 (1M context) --- go-checkers/check_go_versions.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/go-checkers/check_go_versions.sh b/go-checkers/check_go_versions.sh index af12c37..0782587 100755 --- a/go-checkers/check_go_versions.sh +++ b/go-checkers/check_go_versions.sh @@ -32,6 +32,10 @@ GOTESTS_FILE="" if [ -n "$GOTESTS_FILE" ]; then grep -q 'uses:.*\.github/workflows/' "$GOTESTS_FILE" && echo "INFO: $GOTESTS_FILE uses a reusable workflow, skipping." && exit 0 GOTESTS_VERSION=$(grep 'go-version:' "$GOTESTS_FILE" | sed -E 's/.*go-version:\s*"?([0-9]+\.[0-9]+)"?.*/\1/') + if [ -z "$GOTESTS_VERSION" ]; then + echo "INFO: $GOTESTS_FILE does not declare go-version, skipping." + exit 0 + fi echo "INFO: $GOTESTS_FILE: $GOTESTS_VERSION" else echo "INFO: This repository doesn't have a gotests.yaml/yml file. Exiting"