fix(ci): replace cross-repo actions/checkout with direct git clone #3
No reviewers
Labels
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: molecule-ai/molecule-ci#3
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/git-clone-instead-of-actions-checkout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes the third root cause uncovered by verification cycle 3 on
plugin-molecule-careful-bash#2.Failure shape (post molecule-ci#2 merge)
actions/checkout@v4declarestokenasrequired: falsewith a default of${{ github.token }}. But the action's runtime auth-helper code callscore.getInput("token", { required: true })— passingtoken: ""triggers the input-required check, not the anonymous-fetch path.The fix
Replace the cross-repo
actions/checkout@v4with a directgit cloneshell step. molecule-ci is public; anonymous git clone has neither the auth-trips-Gitea-404 problem (#2 target) nor the empty-token-input-required problem (#2 actual failure).3 files, 4 sites:
validate-plugin.yml(1)validate-workspace-template.yml(2)validate-org-template.yml(1)Why this is correct
actions/checkoutadds value overgit clonemainly for: (a) auto-injecting auth fromgithub.token, (b) submodule handling, (c) LFS, (d) commit ref resolution from PR events. None apply here:main(latest canonical scripts), not the PR's refPlain
git clone --depth 1gives us exactly what we need.Hostile self-review
Three weakest spots:
No version pinning —
git clone --depth 1 ...always grabs HEAD ofmain. If molecule-ci ships a breaking change toscripts/validate-plugin.pyit lands in every plugin's CI immediately. That's by-design (the comments in the original file explicitly call out "single source of truth, fetched fresh"), but worth noting. Mitigation: any breaking change to the validator should land in molecule-ci with a synthetic CI run against at least one consumer first.Anonymous traffic visible in act_runner logs — the clone URL appears in the runner log without auth obfuscation. Not a credential leak (no auth is sent), but a future operator reading the log can confirm we hit anon. Acceptable.
Doesn't
gitneed to exist in the runner image? — yes,catthehacker/ubuntu:full-latestincludes git 2.x. If the runner image changes, this breaks. Acceptable; it's a baseline tool. The previous cross-repoactions/checkoutalso requires git in the image so this isn't a new dependency.Rollout / rollback
plugin-molecule-careful-bash#2CI → if GREEN, mass-merge the 33 downstream lowercase-slug PRs.git revertthis PR to restore thetoken: ""shape from #2 (which was already broken, but the repo state would match the previous diff).🤖 Generated with Claude Code
Direct git-clone replaces brittle cross-repo actions/checkout. Public repo, no auth needed. Hostile self-review accepted (anon visible in logs is fine; git is in act_runner image).