Skip to main content

Module github

Module github 

Source
Expand description

GitHub source — shallow-clone a ref into the global store (tar.gz fallback), with ref-candidate fallbacks and token auth. Rust port of sources/github.ts.

Clones happen via a git SHELL-OUT (not a git library) so the opensrc authenticated_clone_url token injection + redact_token scrubbing port verbatim, including the #66 host-confusion fix.

Structs§

GithubOptions
Options for a github fetch (port of GithubSourceOptions).

Functions§

authenticated_clone_url
Rewrite an HTTPS GitHub clone URL to embed x-access-token:<token> auth, but ONLY on an exact github.com host over https (opensrc #66: prefix/suffix- confusable hosts, subdomains, non-https schemes, and ssh remotes pass through unchanged). The result carries the secret — use it only as a git argument, never in logs.
fetch
Fetch docs for a github entry, materializing the checkout into the store.
github_token
The GITHUB_TOKEN from the environment, empty string treated as absent.