fix(ci): Go toolchain steps skip even when .go files are changed #358

Closed
opened 2026-07-08 08:39:51 +00:00 by fuzzy · 1 comment
Owner

Bug

The "skip Go tooling when no .go files changed" optimization (issue #334) has a false-negative: Go steps are skipped even on PRs that do modify .go files.

Evidence

PR #355 modifies .go files, but its action run 142 skipped go vet, go test, and golangci-lint entirely.

Cause

Likely one of:

  • Path glob in the changed-files step doesn't match the actual file paths (e.g., **/*.go vs repo layout, or go.mod/go.sum excluded)
  • changed-files action compares against wrong base ref (e.g., comparing PR head against itself instead of target branch)
  • Step conditional evaluates incorrectly — any_changed is false when it should be true

Fix

  1. Inspect the CI workflow in .forgejo/workflows/
  2. Verify the glob pattern against actual changed files in PR #355
  3. Test the changed-files action output directly with a debug step
  4. Fix the conditional or glob, then verify with a test PR

Verification

  • Push a test commit that only touches a .go file — Go steps should run
  • Push a test commit that only touches a .md file — Go steps should skip
  • Both cases should pass CI
## Bug The "skip Go tooling when no .go files changed" optimization (issue #334) has a false-negative: Go steps are skipped even on PRs that *do* modify `.go` files. ## Evidence PR [#355](https://git.lan.thwap.org/thwap/steeper/pulls/355) modifies `.go` files, but its action run [142](https://git.lan.thwap.org/thwap/steeper/actions/runs/142/jobs/0/attempt/1) skipped `go vet`, `go test`, and `golangci-lint` entirely. ## Cause Likely one of: - Path glob in the `changed-files` step doesn't match the actual file paths (e.g., `**/*.go` vs repo layout, or `go.mod`/`go.sum` excluded) - `changed-files` action compares against wrong base ref (e.g., comparing PR head against itself instead of target branch) - Step conditional evaluates incorrectly — `any_changed` is `false` when it should be `true` ## Fix 1. Inspect the CI workflow in `.forgejo/workflows/` 2. Verify the glob pattern against actual changed files in PR #355 3. Test the `changed-files` action output directly with a debug step 4. Fix the conditional or glob, then verify with a test PR ## Verification - Push a test commit that only touches a `.go` file — Go steps should run - Push a test commit that only touches a `.md` file — Go steps should skip - Both cases should pass CI
fuzzy self-assigned this 2026-07-08 08:39:51 +00:00
fuzzy changed title from actions run skip go tests even if go files have changed to fix(ci): Go toolchain steps skip even when .go files are changed 2026-07-08 08:40:09 +00:00
Author
Owner

Issue not resolved.

Check for Go changes                                                                                                                       0s
1 fatal: ambiguous argument 'HEAD^1..HEAD^2': unknown revision or path not in the working tree.
2 Use '--' to separate paths from revisions, like this:
3 'git <command> [<revision>...] -- [<file>...]'

this step, somehow was in success state. That definitely, should not be.

Issue not resolved. ``` Check for Go changes 0s 1 fatal: ambiguous argument 'HEAD^1..HEAD^2': unknown revision or path not in the working tree. 2 Use '--' to separate paths from revisions, like this: 3 'git <command> [<revision>...] -- [<file>...]' ``` this step, somehow was in success state. That definitely, should not be.
fuzzy closed this issue 2026-07-08 09:04:48 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/steeper#358
No description provided.