🤖 ci: document fetch-depth for paths-filter changes#17
Merged
Conversation
Add an inline comment explaining why the changes job uses fetch-depth: 0, so dorny/paths-filter can diff push events using github.event.before without requiring a follow-up fetch. --- _Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.20`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.20 -->
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Add a project-level .mux/tool_env that defines run_and_report so bash invocations can reuse consistent step logging and fail-fast behavior. Document the helper in AGENTS.md with usage examples. --- _Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.20`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.20 -->
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documented why the
changesjob uses full history checkout in CI.Background
dorny/paths-filtercomparesgithub.event.beforeto the current ref on push events. A shallow checkout can miss thebeforecommit and force an extra fetch that may fail when credentials are not persisted.Implementation
fetch-depth: 0in.github/workflows/ci.yamlto explain the behavior and rationale.Validation
go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.10📋 Implementation Plan
Plan: Fix “Detect changed paths” failing on
mainContext / Why
The GitHub Actions job “Detect changed paths” (uses
dorny/paths-filter) is failing on pushes tomainwith:<before_sha>andmain”<before_sha>is fetched from origin”gitexits with code 128On
pushevents,paths-filterdiffsgithub.event.before→github.ref/main. With a shallow checkout, thebeforecommit is often missing locally, so the action tries to fetch it. Because the workflow usesactions/checkoutwithpersist-credentials: false, that follow-up fetch can fail (common in private repos / restricted environments), producing the observed error.Evidence (what we verified)
paths-filterattempting to fetch thebeforeSHA and failing withgitexit code 128..github/workflows/ci.yaml:changesjob checks out code withpersist-credentials: falseand nofetch-depth, sofetch-depthdefaults to 1 (shallow). (Lines 15–30)changesjob runsdorny/paths-filterfor non-merge_groupevents. (Lines 41–64)Implementation details (edits to make)
1) Fetch enough history in the
changesjobEdit
.github/workflows/ci.yamlin thejobs.changes.stepscheckout step to fetch full history (recommended) sopaths-filternever needs to perform an extragit fetch.Change:
Notes:
fetch-depth: 0is the most robust fix (handles multi-commit pushes, merge commits, and non-linear history).fetch-depth: 2might work for typical “single new commit” pushes, but is brittle; prefer0unless checkout performance is a proven issue.Validation / Rollout
go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.10push-to-mainCI run completes theDetect changed pathsjob.gitstderr from the action logs; the next fallback is to keep shallow checkout but allow authenticated fetch (removepersist-credentials: falsefor just thechangesjob or explicitly pass auth), but this should not be necessary withfetch-depth: 0.Generated with
mux• Model:openai:gpt-5.3-codex• Thinking:xhigh• Cost:$0.20