New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Action is not detecting some violations #496
Comments
Similar issue for me.
However, the GitHub Action is NOT detecting these violations. Both my local and GH actions are using the v1.49.0 of of golangci-lint. Github Action configjobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Deps
env:
NETRC: ${{ secrets.NETRC }}
GOPRIVATE: "***"
run: |
echo "${NETRC}" > ~/.netrc
go mod download
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
skip-pkg-cache: true .golangci.yamloutput:
format: tab
print-issue-lines: true
print-linter-name: true
linters-settings:
errcheck:
exclude-functions: []
issues:
exclude-rules:
path: _test\.go
linters:
- errcheck Latest run output
|
@ldez what further information is required? |
it can be a side effect of cache, so you have to disable the internal action cache. |
@ldez we did disable the cache and the error still persists
|
I am encountering the same issue. Anyone has fix on this one? |
Ran into the same issue, even when disabling caching completely, I still am missing violations that are shown on local runs. I even ran just the raw bin, with a mostly clean env, CI is still missing violations. golangci-2:
name: lint-2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
cache: false
- name: test linter manually
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.54.2 && \
gh pr diff 10555 > pr.diff && env -i HOME="$HOME" PATH="$PATH" ./bin/golangci-lint run --out-format colored-line-number --new-from-patch=pr.diff |
My issue ended up stemming from compilation errors that were silently ignored during the execution on the lint action. Running a |
In https://github.com/orgs/community/discussions/68471 @lisanna-dettwyler wrote:
In my case, I think that's ☝️ what prevents all the errors showing up in the GitHub UI. xref: |
Hello, I added a new option I added this option for several reasons:
If you set https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#annotations |
Since a couple of weeks we have been seeing repeatedly that the action does not report some violations while there are some in the code.
We event tested it running with no cache and the issue still persists? Do you have any idea?
In case it works the troubleshoot, the last error that was not detected was:
We are using the following configuration:
Github Action config
.golangci.yml
Below is the output of the last run that did not find an issue.
Latest run output
The text was updated successfully, but these errors were encountered: