golangci-latest job fails with typecheck errors due to missing config.toml
github_actions
The `golangci-latest` CI job is currently failing with `typecheck` errors when running golangci-lint:
```
pkg/config/config.go:250:12: pattern config.toml: no matching files found (typecheck)
//go:embed config.toml
```
This happens because `pkg/config/config.toml` is generated in the `config` job but is not available in the `golangci-latest` job. As a result, the linter cannot build the package, and `only-new-issues` filtering does not apply.
**Steps to Reproduce:**
* Open a pull request that does not touch `pkg/config/config.go` or `pkg/config/config.toml`.
* Observe that `golangci-latest` fails with a `typecheck` error.
```
run golangci-lint
only new issues on pull_request: /tmp/tmp-2138-p9VgJ0wsaW17/pull.patch
Running [/home/runner/golangci-lint-2.5.0-linux-amd64/golangci-lint config path] in [/home/runner/work/cli/cli] ...
Running [/home/runner/golangci-lint-2.5.0-linux-amd64/golangci-lint config verify] in [/home/runner/work/cli/cli] ...
Running [/home/runner/golangci-lint-2.5.0-linux-amd64/golangci-lint run --new-from-patch=/tmp/tmp-2138-p9VgJ0wsaW17/pull.patch --new=false --new-from-rev= --new-from-merge-base=] in [/home/runner/work/cli/cli] ...
Error: pkg/config/config.go:250:12: pattern config.toml: no matching files found (typecheck)
//go:embed config.toml
^
1 issues:
* typecheck: 1
Error: issues found
Ran golangci-lint in 21267ms
```
**Expected Behavior:**
The `golangci-latest` job should run successfully and only report linter issues introduced by the PR diff.
**Proposed Fix:**
* Make `golangci-latest` depend on the config job.
* Download the `pkg/config/config.toml` artifact into the correct path before running `golangci-lint`.
* Optionally verify the file exists to avoid typecheck failures.
关闭于 2025-10-15 0 条评论