From 7748dc559cf3ebac60be2b2ffa0c8a461b3da57b Mon Sep 17 00:00:00 2001 From: Lifailon Date: Fri, 30 Jan 2026 03:42:48 +0300 Subject: [PATCH] fix linters check in workflow --- .github/workflows/lint-fix.yml | 16 ++++++++-------- .github/workflows/ppa.yml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lint-fix.yml b/.github/workflows/lint-fix.yml index 8996f11..d590839 100644 --- a/.github/workflows/lint-fix.yml +++ b/.github/workflows/lint-fix.yml @@ -126,14 +126,14 @@ jobs: if: ${{ github.event.inputs.golangci == 'true' || github.event.inputs.Fix == 'true' }} run: golangci-lint config verify --verbose - - name: Get linters for check to summary + - name: Get linters from config to summary if: ${{ github.event.inputs.golangci == 'true' || github.event.inputs.Fix == 'true' }} run: | golangci-lint --version version=$(golangci-lint --version | grep -Eo "[0-9.]+" | head -n 1) echo "### Configuration" >> $GITHUB_STEP_SUMMARY echo "Golangci version: $version" >> $GITHUB_STEP_SUMMARY - echo "Check config status: ${{ steps.configCheck.outcome }}" + echo "Check config status: ${{ steps.configCheck.outcome }}" >> $GITHUB_STEP_SUMMARY golangci-lint linters golangci-lint linters > linters.md sed "s/Enabled by your configuration linters:/## Enabled linters/" -i linters.md @@ -142,11 +142,11 @@ jobs: sed "s/. \[(.+)\]/ (**$1**)./g" -i linters.md sed -E "s/\. \[(.+)\]/ (**\1**)./g" -i linters.md linters=$(cat linters.md | awk -F ":" '/:/ {print "- [" $1"](https://golangci-lint.run/docs/linters/configuration/#"$1") -" $2":"$3; next} {print $0}') - echo "$linters" > linters.md + echo "$linters" >> $GITHUB_STEP_SUMMARY - - name: Golangci install and linters check using action + - name: Golangci linters check using Action id: golangci - if: ${{ github.event.inputs.golangci == 'true' }} + if: ${{ github.event.inputs.golangci == 'true' || github.event.inputs.Fix == 'true' }} continue-on-error: true uses: golangci/golangci-lint-action@v9 with: @@ -154,11 +154,11 @@ jobs: args: ./main.go - name: Get issues result from linters check to summary - if: ${{ github.event.inputs.golangci == 'true' }} + if: ${{ github.event.inputs.golangci == 'true' || github.event.inputs.Fix == 'true' }} continue-on-error: true run: | echo "### Linters check results" >> $GITHUB_STEP_SUMMARY - golangci-lint run ./main.go > results.md + golangci-lint run ./main.go > results.md || true sed -n '/issues:/,$p' -i results.md cat results.md >> $GITHUB_STEP_SUMMARY @@ -180,7 +180,7 @@ jobs: continue-on-error: true run: | echo "### Linters check results after fix" >> $GITHUB_STEP_SUMMARY - golangci-lint run ./main.go > results.md + golangci-lint run ./main.go > results.md || true sed -n '/issues:/,$p' -i results.md cat results.md >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/ppa.yml b/.github/workflows/ppa.yml index 2b9c049..78adc0a 100644 --- a/.github/workflows/ppa.yml +++ b/.github/workflows/ppa.yml @@ -66,7 +66,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y golang-1.23-go - longsleep/golang-backports + go version - name: Install dependencies for build deb package if: ${{ github.event.inputs.Install != 'true' }}