From d50d4c8edecddb085758ee7bcdf2b7109f0a0a26 Mon Sep 17 00:00:00 2001 From: chainchad <96362174+chainchad@users.noreply.github.com> Date: Thu, 15 Jan 2026 11:28:46 -0500 Subject: [PATCH] Fix lint output and artifacts --- .github/workflows/golangci_lint.yml | 18 ++++++++++++++++-- script/lint.sh | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/golangci_lint.yml b/.github/workflows/golangci_lint.yml index ac7274cf95..f90e5e7b35 100644 --- a/.github/workflows/golangci_lint.yml +++ b/.github/workflows/golangci_lint.yml @@ -44,15 +44,29 @@ jobs: version=$(grep '^golangci-lint ' .tool-versions | awk '{print $2}') echo "version=${version}" | tee -a "$GITHUB_OUTPUT" + - name: Sanitize artifact name + id: artifact-name + env: + MODULE: ${{ matrix.module }} + run: | + safe_name="${MODULE#./}" + safe_name="${safe_name#/}" + safe_name="${safe_name//\//-}" + if [[ -z "$safe_name" || "$safe_name" = "." ]]; then + safe_name="root" + fi + echo "value=golangci-lint-report-${safe_name}" | tee -a "$GITHUB_OUTPUT" + - name: golangci-lint ${{ matrix.module }} if: ${{ always() && !contains(join(github.event.pull_request.labels.*.name, ' '), 'allow-lint-issues') }} # NOTE: Keep this version in sync with ACTION_CI_LINT_GO_GIT_TAG in ./script/lint.sh - uses: smartcontractkit/.github/actions/ci-lint-go@ci-lint-go/3.0.0 + uses: smartcontractkit/.github/actions/ci-lint-go@ci-lint-go/v4 with: checkout-repo: false + artifact-name: ${{ steps.artifact-name.outputs.value }} golangci-lint-version: v${{ steps.get-version.outputs.version }} go-directory: ${{ matrix.module }} - golangci-lint-args: --output.text.path=stdout --output.checkstyle.path=${{ matrix.module }}/golangci-lint-report.xml + golangci-lint-args: "--output.text.path=stdout --output.checkstyle.path=${{ github.workspace }}/${{ matrix.module }}/golangci-lint-report.xml" golangci-lint: # Required sink job that waits for all lint jobs to complete diff --git a/script/lint.sh b/script/lint.sh index da256f38ab..75fd0786dd 100755 --- a/script/lint.sh +++ b/script/lint.sh @@ -27,7 +27,7 @@ if [[ -n "${GOLANGCI_LINT_CONFIG:-}" ]]; then echo "Using user-provided config: $CONFIG_FILE" else # NOTE: Keep this version in sync with the action tag in /.github/workflows/golangci_lint.yml - ACTION_CI_LINT_GO_GIT_TAG="${CI_LINT_GO_VERSION:-ci-lint-go/3.0.0}" + ACTION_CI_LINT_GO_GIT_TAG="${CI_LINT_GO_VERSION:-ci-lint-go/v4}" # Download remote golangci-lint config to gitignored directory REMOTE_CONFIG_URL="https://raw.githubusercontent.com/smartcontractkit/.github/refs/tags/${ACTION_CI_LINT_GO_GIT_TAG}/actions/ci-lint-go/files/golangci-default.yml" CONFIG_FILE="$DIRECTORY/golangci.remote.yml"