Skip to content

golangci-lint-action failed on Push due to unable fetching commit diffs with --only-new-issues set #1039

Closed
@ZiqianXu

Description

@ZiqianXu

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

We noticed golangci-lint-action started to fail recently due to enable to fetch commit diffs and instead analyzing the whole repo.

The error messages are

failed to fetch push patch: RequestError [HttpError]: Not Found
...
at async prepareEnv (/home/runner/work/_actions/golangci/golangci-lint-action/v6/dist/run/index.js:89264:23) {
   status: 404,
   response: {
     url: 'https://api.github.com/repos/<owner>/<repo>/compare/76d57f3a98ce42d71b621e9f13a7e46bc5ac1443..2bca1b9[31](https://github.com/<owner>/<repo>/actions/runs/8990379623/job/24707149228#step:4:32)607717b9b69a7f52134e4f3ad64db30',
     status: 404,
...
request: {
     method: 'GET',
     url: 'https://api.github.com/repos//<owner>/<repo>/compare/76d57f3a98ce42d71b621e9f13a7e46bc5ac1443..2bca1b931607717b9b69a7f52134e4f3ad64db30',
     headers: {
       accept: 'application/vnd.github.v3.diff',
       'user-agent': 'octokit-core.js/5.0.1 Node.js/20.8.1 (linux; x64)',
       authorization: 'token [REDACTED]'
     },
     request: {
       agent: [Agent],
       fetch: [Function: proxyFetch],
       hook: [Function: bound bound register]
     }

Is that due to the change to use 2 dots instead of 3 dots in #1030 ?

Version of golangci-lint

v1.58.0

Version of the GitHub Action

v6

Workflow file

steps:
    - name: Checkout Repository
      uses: actions/checkout@v4
    - name: Setup Go
      uses: actions/setup-go@v5
      with:
        go-version: "1.22"
        check-latest: true
    - name: Setup golangci-lint
      uses: golangci/golangci-lint-action@v6
      with:
        version: v1.58.0
        args: --timeout=5m --verbose --config=golangci.yml
        # only check for new linting issues
        only-new-issues: true

Go version

go 1.22

Code example or link to a public repository

// add your code here

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions