Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/golangci_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread Dismissed
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
Expand Down
2 changes: 1 addition & 1 deletion script/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading