golangci-lint "unsupported version of the configuration" (v2) in CI
golangci-lint v2 introduced a new config schema keyed by a version: "2" field. Running a v2 binary against a v1 .golangci.yml fails with an unsupported-version error before any linting.
What this error means
After the binary is upgraded to v2, the run fails with "level=error msg=\"unsupported version of the configuration\"" or a schema validation error against the old config.
level=error msg="unsupported version of the configuration: \"\""Common causes
A v1 config under a v2 binary
v2 expects version: "2" and a restructured config; a config written for v1 (no version field, old keys) is rejected.
The binary upgraded but the config did not migrate
The action or install bumped golangci-lint to v2 while .golangci.yml stayed on the v1 layout.
How to fix it
Migrate the config to v2
- Run the built-in migration command to convert the config.
- Review the generated
version: "2"config and commit it. - Re-run golangci-lint to confirm it loads.
golangci-lint migrate
golangci-lint run ./...Pin to v1 until you migrate
Keep the binary on the v1 line so the existing config keeps working, then migrate as a separate change.
- uses: golangci/golangci-lint-action@v6
with:
version: v1.59.1How to prevent it
- Migrate the config in the same change that bumps to v2.
- Pin the golangci-lint version in the action.
- Read the v2 migration notes before upgrading.