Skip to content

only-new-issues: true option seems broken since v6.3.0 and v6.3.1 releases #1161

Closed
@qdm12

Description

@qdm12

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 use the action pinned as @v6 and with the option only-new-issues: true (full configuration)
Since 3 days ago (2025-02-07) it seems the option only-new-issues: true has no effect only on pushes, given files not changed in the commit pushed (squashed and merged) are being linted.

This can be seen in our commits CI reports of 2025-02-07 in our default branch: commit history

In particular, the last commit only modifies/adds the following files:

  • core/rawdb/database.go
  • core/rawdb/database.libevm.go
  • core/rawdb/database.libevm_test.go

But the action lints for example file libevm/pseudo/rlp_test.go (logs line) which is NOT part of that commit.

And the commit before that one works as expected, however.

This might correlate with the v6.3.0 release.

Version of golangci-lint

v1.60.3

Version of the GitHub Action

v6

Workflow file

name: golangci-lint

on:
  push:
    branches: [main, "release/**"]
  pull_request:
    branches: [main, "release/**"]
  workflow_dispatch:

permissions:
  # Required: allow read access to the content for analysis.
  contents: read
  # Optional: allow read access to pull request. Use with `only-new-issues` option.
  pull-requests: read

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
  golangci:
    name: lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-go@v5
        with:
          go-version-file: "go.mod"
      - name: goheader
        # The goheader linter is only enabled in the CI so that it runs only on modified or new files
        # (see only-new-issues: true). It is disabled in .golangci.yml because
        # golangci-lint running locally is not aware of new/modified files compared to the base
        # commit of a pull request, and we want to avoid reporting invalid goheader errors.
        uses: golangci/golangci-lint-action@v6
        with:
          version: v1.60
          only-new-issues: true
          args: --enable-only goheader
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v6
        with:
          version: v1.60

Golangci-lint configuration

https://github.com/ava-labs/libevm/blob/main/.github/workflows/golangci-lint.yml
https://github.com/ava-labs/libevm/blob/main/.libevm-header

# This file configures github.com/golangci/golangci-lint.

run:
  timeout: 20m
  tests: true

linters:
  enable:
    # Every available linter at the time of writing was considered (quickly) and
    # inclusion was liberal. Linters are good at detecting code smells, but if
    # we find that a particular one causes too many false positives then we can
    # configure it better or, as a last resort, remove it.
    - containedctx
    - errcheck
    - forcetypeassert
    - gci
    - gocheckcompilerdirectives
    - gofmt
    # goheader is disabled but it is enabled in the CI with a flag.
    # Please see .github/workflows/golangci-lint.yml which explains why.
    # - goheader
    - goimports
    - gomodguard
    - gosec
    - govet
    - ineffassign
    # TODO(arr4n): investigate ireturn
    - misspell
    - nakedret
    - nestif
    - nilerr
    - nolintlint
    - reassign
    - revive
    - sloglint
    - staticcheck
    - tagliatelle
    - testableexamples
    - testifylint
    - thelper
    - tparallel
    - unconvert
    - usestdlibvars
    - unused
    - whitespace

linters-settings:
  gci:
    custom-order: true
    sections:
      - standard
      - default
      - localmodule
      # The rest of these break developer expections, in increasing order of
      # divergence, so are at the end to increase the chance of being seen.
      - alias
      - dot
      - blank
  goheader:
    template-path: .libevm-header

  gomodguard:
    blocked:
      modules:
        - github.com/ethereum/go-ethereum:
            reason: "Original, forked repo"
        - github.com/ava-labs/avalanchego:
            reason: "Avoid dependency loop"
        - github.com/ava-labs/coreth:
            reason: "Avoid dependency loop"
        - github.com/ava-labs/subnet-evm:
            reason: "Avoid dependency loop"
  revive:
    rules:
      - name: unused-parameter
        # Method parameters may be required by interfaces and forcing them to be
        # named _ is of questionable benefit.
        disabled: true

issues:
  exclude-dirs-use-default: false
  exclude-rules:
    - path-except: libevm
      linters:
        # If any issue is flagged in a non-libevm file, add the linter here
        # because the problem isn't under our control.
        - containedctx
        - forcetypeassert
        - errcheck
        - gci
        - gofmt
        - goheader
        - goimports
        - gosec
        - gosimple
        - govet
        - nakedret
        - nestif
        - nilerr
        - nolintlint
        - revive
        - staticcheck
        - tagliatelle
        - testableexamples
        - testifylint
        - thelper
        - tparallel
        - typecheck
        - usestdlibvars
        - varnamelen
        - wastedassign
        - whitespace
  include:
    # Many of the default exclusions are because, verbatim "Annoying issue",
    # which defeats the point of a linter.
    - EXC0002
    - EXC0004
    - EXC0005
    - EXC0006
    - EXC0007
    - EXC0008
    - EXC0009
    - EXC0010
    - EXC0011
    - EXC0012
    - EXC0013
    - EXC0014
    - EXC0015

Go version

1.20

Code example or link to a public repository

https://github.com/ava-labs/libevm/

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