fix(claude-review): don't re-fetch a base commit the checkout already has - #92
Merged
crowecawcaw merged 1 commit intoAug 7, 2026
Conversation
… has On a private repo the review stage died before reaching the agent: git fetch --depth=1 origin "$BASE_SHA" fatal: could not read Username for 'https://github.com': No such device or address The PR-head checkout sets persist-credentials: false on purpose, so no token is left on disk for the agent to read -- which also means a later git fetch has no credential. Public repos fetch anonymously and never notice; a private repo has no anonymous access, so the step fails. The fetch was redundant anyway: that checkout uses fetch-depth: 0, so the base commit is normally already in the clone. Only fetch when it truly is not present, which keeps persist-credentials: false intact and adds no token handling. A genuine missing-object fetch failure still fails the step. No behavior change for the public repos already using this workflow. Signed-off-by: Stephen Crowe <6042774+crowecawcaw@users.noreply.github.com>
crowecawcaw
marked this pull request as ready for review
August 7, 2026 23:35
waninggibbon
approved these changes
Aug 7, 2026
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.
What was the problem/requirement? (What/Why)
Enabling the Claude PR-review workflows on a private repo.
The step order shows how far it got — everything security-relevant worked, then it tripped on step 6:
Cause: the PR-head checkout sets
persist-credentials: falsedeliberately, so no token is left on disk for the agent to read. That also leaves no credential for a latergit fetch. Public repos fetch anonymously and never notice; a private repo has no anonymous access, so the step fails.The fetch was redundant anyway. That same checkout uses
fetch-depth: 0, so the base commit is normally already in the clone. In the failing run the log shows* [new branch] main -> origin/main, andae90810is main's tip — the job died on an unauthenticated fetch of an object it already had.What was the solution? (How)
Only fetch when the base commit genuinely is not present:
This keeps
persist-credentials: falseintact and introduces no token handling into the step. I deliberately preferred this over passing a one-shothttp.extraheadercredential: it is the smaller change to a security-sensitive shared workflow, and it needs no secret in a step that runs before the agent.^{commit}rather than a bare SHA so a tree/blob SHA cannot satisfy the check.What is the impact of this change?
deadline-cloud,deadline-cloud-worker-agent,deadline-cloud-samples,deadline-cloud-for-blender): no behavior change. The base commit is already present, so where they previously ran a successful redundant fetch they now skip it. Marginally faster.How was this change tested?
zizmoragainst this repo's ownzizmor.yml: no findings.Verified the shell logic in a scratch repo across all three paths, checking exit codes rather than just output:
^{commit}The third case is the one that matters for not masking real problems:
set -euo pipefailplus||only swallows the probe's failure, not the fetch's, so a genuinely missing object still fails the step.Was this change documented?
Yes — a comment on the step explains why the fetch is conditional, so it is not "simplified" back into an unconditional fetch later.
Does this PR introduce new dependencies?
No.
Is this a breaking change?
No.
Does this change impact security?
No weakening. The change avoids introducing a credential rather than adding one:
persist-credentials: falseis unchanged, so still no token on disk for the agent.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.