Skip to content

ci(changes): make pre-flight diff permissive on missing base ref#363

Merged
trilamsr merged 1 commit into
mainfrom
ci/fix-changes-flake
Jun 1, 2026
Merged

ci(changes): make pre-flight diff permissive on missing base ref#363
trilamsr merged 1 commit into
mainfrom
ci/fix-changes-flake

Conversation

@trilamsr

@trilamsr trilamsr commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

CI `changes` pre-flight job intermittently fails with exit 128 when `origin/$base` ref isn't fully fetched (shallow-clone race / fresh runner). `git diff origin/$base...HEAD` then exits non-zero; `bash -e` propagates and fails the whole workflow.

Root cause

`set -e` from `bash -e` causes the command-substitution `changed=$(git diff ...)` to abort on non-zero exit even with `2>/dev/null` redirecting stderr. Append `|| true` so failure falls through to the existing "treat as code-changed" default.

Test plan

  • yaml.safe_load parses cleanly
  • actionlint + zizmor clean
  • golangci-lint + go vet + attribute-namespace-check + doc-check + alert-check + chart-appversion-check + deprecation-check + no-autoupdate-check all green
  • Verified by next PR's pre-flight running green

Reproduced flake on PRs #347 + #357.

@trilamsr trilamsr merged commit ebff2ed into main Jun 1, 2026
11 checks passed
@trilamsr trilamsr deleted the ci/fix-changes-flake branch June 1, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant