From bce0fcc501390857c6fbbdb498aa358fcc794649 Mon Sep 17 00:00:00 2001 From: Hector Martinez Date: Fri, 12 Jun 2026 11:39:14 +0200 Subject: [PATCH] fix(#2060): set up Go on runner before post-code pre-commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a target repo's go.mod declares a Go version newer than the golangci-lint binary installed by pre-commit's language: golang mechanism, golangci-lint exits with code 3 before analyzing any code — blocking PR creation. Add a conditional actions/setup-go step in action.yml that runs before fullsend (and therefore before post-code.sh's authoritative pre-commit gate). The step reads the target repo's go.mod via go-version-file and installs the matching toolchain on the runner. pre-commit then uses that toolchain when building golangci-lint, satisfying the version requirement. The step is skipped entirely for non-Go repos (hashFiles guard), so there is no latency impact on other runs. cache: false avoids polluting the runner's module cache with the target repo's dependencies. Signed-off-by: Hector Martinez --- action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/action.yml b/action.yml index 5d35a339f..00feae764 100644 --- a/action.yml +++ b/action.yml @@ -331,6 +331,13 @@ runs: shell: bash run: pip install --quiet "jsonschema>=4.18.0" + - name: Set up Go for target repo pre-commit hooks + if: hashFiles('target-repo/go.mod') != '' + uses: actions/setup-go@v6 + with: + go-version-file: target-repo/go.mod + cache: false + - name: Run fullsend if: inputs.agent != '__install_only__' shell: bash