From ecfb1ef1d251d9fad9f569f5f3aecc332e137113 Mon Sep 17 00:00:00 2001 From: Caleb Doxsey Date: Thu, 14 Dec 2023 14:42:16 -0700 Subject: [PATCH] webauthn/ci: upgrade golangci-lint --- .../workflows/{golangci-lint.yml => lint.yml} | 22 +++++++++++-------- Makefile | 5 +++++ 2 files changed, 18 insertions(+), 9 deletions(-) rename .github/workflows/{golangci-lint.yml => lint.yml} (52%) create mode 100644 Makefile diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/lint.yml similarity index 52% rename from .github/workflows/golangci-lint.yml rename to .github/workflows/lint.yml index 727f650..e8b0b87 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/lint.yml @@ -1,22 +1,26 @@ -name: golangci-lint +name: Lint +permissions: + contents: read on: push: - tags: - - v* branches: - - master - main - pull_request: + pull_request: {} + jobs: - golangci: - name: lint + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + with: + fetch-depth: 0 - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe with: go-version: 1.21.x + cache: false - - name: Lint - uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc + - uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc + with: + version: v1.55 + args: --timeout=10m diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b452e1f --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +.PHONY: lint +lint: + @echo "@==> $@" + @VERSION=$$(go run github.com/mikefarah/yq/v4@v4.34.1 '.jobs.lint.steps[] | select(.uses == "golangci/golangci-lint-action*") | .with.version' .github/workflows/lint.yml) && \ + go run github.com/golangci/golangci-lint/cmd/golangci-lint@$$VERSION run ./...