golangci/golangci-lint-action

The action fails validation on custom linters configuration

andersroos opened this issue · 6 comments

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,

We use custom linters and our golangci-lint action just started failing with validation errors on .golangci.yaml.

The message we get is:

Error: Failed to run: Error: Command failed: /home/runner/go/bin/golangci-lint config verify
38
jsonschema: "linters-settings.custom.connecterr" does not validate with "/properties/linters-settings/properties/custom/patternProperties/%5E.%2A$/oneOf": oneOf failed, subschemas 0, 1 matched
39
jsonschema: "linters-settings.custom.clouderr" does not validate with "/properties/linters-settings/properties/custom/patternProperties/%5E.%2A$/oneOf": oneOf failed, subschemas 0, 1 matched
40
jsonschema: "linters-settings.custom.translatedstring" does not validate with "/properties/linters-settings/properties/custom/patternProperties/%5E.%2A$/oneOf": oneOf failed, subschemas 0, 1 matched
41
Failed executing command with error: the configuration contains invalid elements
42
, Error: Command failed: /home/runner/go/bin/golangci-lint config verify
43
jsonschema: "linters-settings.custom.connecterr" does not validate with "/properties/linters-settings/properties/custom/patternProperties/%5E.%2A$/oneOf": oneOf failed, subschemas 0, 1 matched
44
jsonschema: "linters-settings.custom.clouderr" does not validate with "/properties/linters-settings/properties/custom/patternProperties/%5E.%2A$/oneOf": oneOf failed, subschemas 0, 1 matched
45
jsonschema: "linters-settings.custom.translatedstring" does not validate with "/properties/linters-settings/properties/custom/patternProperties/%5E.%2A$/oneOf": oneOf failed, subschemas 0, 1 matched
46
Failed executing command with error: the configuration contains invalid elements
47

48
    at genericNodeError (node:internal/errors:984:15)
49
    at wrappedFn (node:internal/errors:538:14)
50
    at ChildProcess.exithandler (node:child_process:422:12)
51
    at ChildProcess.emit (node:events:519:28)
52
    at maybeClose (node:internal/child_process:1105:16)
53
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)
54
Error: Command failed: /home/runner/go/bin/golangci-lint config verify
55

Could maybe be related to this one as turning off validating made it start working again: #1171

Version of golangci-lint

v1.63.4

Version of the GitHub Action

v6

Workflow file

  lint:
    steps:
      - uses: golangci/golangci-lint-action@v6
        with:
          version: v1.63.4
          args: --timeout 3m0s
          skip-pkg-cache: true
          skip-build-cache: true
          install-mode: "goinstall"

Golangci-lint configuration

run:
  go: "1.23.5"

linters:
  enable:
    - errcheck
    - gosimple
    - govet
    - ineffassign
    - staticcheck
    - typecheck
    - unused
    - revive

linters-settings:
  staticcheck:
    checks:
      - all
  custom:
    connecterr:
      path: connecterr.so
      description: xyz
    clouderr:
      path: clouderr.so
      description: xyz
    translatedstring:
      path: translatedstring.so
      description: xyz
  revive:
    rules:
      - name: var-naming
        disabled: true

Go version

1.23.5

Code example or link to a public repository

Not a public repo.

Forgot to mention, adding verify: false to the action config is a viable workaround.

Fixed our issues, looks like there were some changes in the configuration file that needed looking at https://golangci-lint.run/usage/linters

Might be worth posting your .golangci.yaml / validating against the latest docs

I did post it, it is under "Golangci-lint configuration" above. Can't see anything wrong with it related to the docs, the fields the validator complains about looks correct to me.

Can't see anything wrong with it related to the docs, the fields the validator complains about looks correct to me.

I think the root cause might addressed here by @Namnamseo

So for now verify: false is an option

ldez commented

The jsonschemas have been updated.