From a0817081887f71cbd7f1f3f0b5a57fa08e845fad Mon Sep 17 00:00:00 2001 From: "Abdurakhman R." Date: Tue, 29 Oct 2024 04:36:49 +0500 Subject: [PATCH] [ADD] added CI go linters; --- .github/workflows/ci-go-lint.yml | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/ci-go-lint.yml diff --git a/.github/workflows/ci-go-lint.yml b/.github/workflows/ci-go-lint.yml new file mode 100644 index 0000000..4be307b --- /dev/null +++ b/.github/workflows/ci-go-lint.yml @@ -0,0 +1,48 @@ +name: ci-go-lint + +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' + schedule: + - cron: "0 0 * * *" + +permissions: + contents: read + +jobs: + go_lint: + permissions: + contents: read # for actions/checkout to fetch code + pull-requests: read # for golangci/golangci-lint-action to fetch pull requests + if: github.event.pull_request.draft == false || github.event_name == 'push' + name: lint + runs-on: ubuntu-20.04 + steps: + - name: Harden Runner + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + with: + egress-policy: audit + + - name: Checkout Code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Get Go Version + run: | + #!/bin/bash + GOVERSION=$({ [ -f .go-version ] && cat .go-version; }) + echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV + - name: Setup Go + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + with: + go-version: ${{ env.GOVERSION }} + - name: golang-lint + env: + GOGC: 10 + uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1 + with: + version: latest + only-new-issues: true + args: --timeout=10m