Closed
Description
Welcome
- Yes, I understand that the GitHub action repository is not the repository of golangci-lint itself.
- Yes, I've searched similar issues on GitHub and didn't find any.
- Yes, I've included all information below (version, config, etc).
Description of the problem
👋 Hi. Running into a strange problem and I think I've narrowed it down to the action.
Whenever Dependabot makes a new PR then golangci-lint fails. It fails because it seems to ignore the only new issues flag.
In other words the line that runs golangci-lint looks like:
/home/runner/golangci-lint-1.58.2-linux-amd64/golangci-lint run --new-from-patch=/tmp/tmp-1633-UlWI7xtfg9sA/pull.patch --new=false --new-from-rev= --timeout 5m0s
But all the issues in the repo are found, i.e. not just new ones. In theory there shouldn't be any new issues for a dependabot PR, but that's neither here nor there.
The action works perfectly and only flags new issues if somebody other than dependabot makes a PR.
Version of golangci-lint
1.58.2
Version of the GitHub Action
v6
Workflow file
name: golangci-lint
on:
push:
branches:
- main
- master
pull_request:
permissions:
contents: read
pull-requests: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
env:
GOPRIVATE: github.com/xxxx
GH_ACCESS_TOKEN: xxxx
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.number }}/head"
- run: git config --global url."https://[email protected]/".insteadOf "https://github.com/"
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
only-new-issues: true
args: --timeout 5m0s
Go version
1.21.1
Code example or link to a public repository
FWIW here is the dependabot file
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
groups:
gomod:
applies-to: version-updates
patterns:
- "*"
update-types:
- "minor"
- "patch"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"