fix(ci): authenticate cargo git fetches via FORGE_TOKEN #6
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_planner!6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_sameh"
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?
Summary
hero_web_templatewas moved fromlhumina_codetocoopcloud_code/mycelium_dashboard_template_wip. The old URL (still pinned in our Cargo.lock + inhero_admin_lib's Cargo.toml) returns HTTP 301 → 401 on anonymous git fetch, which breaks cargo's libgit2 resolution. Same SHA pin (de4712aa) was building fine until the rename took effect.Fix
Two-line workflow change:
CARGO_NET_GIT_FETCH_WITH_CLI=trueso cargo shells out togit(which can follow the 301 with auth)git config http.https://forge.ourworld.tf/.extraHeader "Authorization: token $FORGE_TOKEN"so every clone toforge.ourworld.tfcarries the bearer — including the redirect targetNo persistent credential is written to disk; config lives only in the job's ephemeral container.
Verification
curlreturns 401 anon;git clonesucceeds when extraHeader is set).lab-publish.yamlviaworkflow_dispatchondevelopment_sameh(run #19, id 23923): SUCCESS, 940s.hero_planner_server / _admin / _weblinux-musl-x86_64) uploaded to thelatestrelease at 13:16–13:19 UTC today.Follow-up (separate)
hero_website_frameworkcould updatehero_admin_lib's Cargo.toml to pointhero_themeat the newcoopcloud_code/mycelium_dashboard_template_wipURL, avoiding the redirect chain entirely for every consumer.mainbranch pushes to also trigger lab-publish (producing alatest-mainrelease)? That depends on the branch-policy decision still in flight — filing separately if/when settled.hero_web_template returns HTTP 401 on anonymous clone despite being marked public on Forgejo. lab-publish's cargo metadata step transitively requires this repo via hero_admin_lib → hero_theme, so cargo can't resolve the workspace and lab build aborts ("no Cargo.toml found"). See CI run #18 on977543b. - CARGO_NET_GIT_FETCH_WITH_CLI=true so cargo shells out to the git CLI (libgit2 has no FORGE_TOKEN-aware credential helper here) - git config http.https://forge.ourworld.tf/.extraHeader with "Authorization: token $FORGE_TOKEN" so the bearer rides every clone to the forge host No persistent credential is written to disk; the config lives only in the job's ephemeral container.