unsloth/.github/workflows
Daniel Han af3f29de83
Withhold HF_TOKEN from pull_request CI runs (#6600)
* Withhold HF_TOKEN from pull_request runs of CI workflows

The pull_request-triggered CI workflows check out and execute PR-controlled
code (install.sh, .github/scripts/**, tests/**) with secrets.HF_TOKEN in the
step environment. For a same-repo PR, GitHub provides repository secrets to the
run, so a malicious or compromised branch could modify a checked-out script to
read and exfiltrate HF_TOKEN, including by writing it into the uploaded logs/
artifact. HF_TOKEN is an external Hugging Face credential of unknown scope, so
this is the high-value exposure.

Gate every HF_TOKEN reference in these workflows with
`github.event_name != 'pull_request' && secrets.HF_TOKEN || ''`, so the real
token flows only on the trusted schedule/push/workflow_dispatch runs and PR runs
see an empty string. All model repos used by these jobs are public
(unsloth/*-GGUF), so anonymous download still works on PRs; install_llama_prebuilt.py
only sends HF auth to Hugging Face hosts and tolerates an absent token.

GITHUB_TOKEN (passed as GH_TOKEN) is intentionally left in place: it is the
auto-provisioned, job-scoped, contents:read token that expires with the job and
gives a same-repo PR author nothing they do not already have, and
install_llama_prebuilt.py needs it to authenticate the GitHub releases API or
the prebuilt llama.cpp download hits the anonymous rate-limit bucket and 403s.

* Trim the HF_TOKEN gating comments to one line per site

Comment/whitespace-only: collapse the per-step rationale to a single line and
shorten the local-agent-guides header note. No workflow logic changes (verified
each file's parsed YAML is identical before/after).
2026-06-23 03:59:12 -07:00
..
consolidated-tests-ci.yml CI: fix import-hoist false positive, vision-cache test cwd, llama.cpp CLI smoke (#6598) 2026-06-23 01:16:47 -07:00
cross-platform-parity-ci.yml Run cross-platform parity test on Windows and macOS in CI (#6241) 2026-06-12 03:40:50 -07:00
lint-ci.yml Lint CI: diff import-hoist check against the PR merge-base, not the base tip (#6190) 2026-06-11 04:23:41 -07:00
local-agent-guides-ci.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
lockfile-audit.yml ci: advisory lockfile supply-chain audit (no install-script changes) (#5604) 2026-05-19 05:56:56 -07:00
mlx-ci.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
notebooks-ci.yml ci: install unsloth_zoo from git main in notebooks-ci + studio-backend-ci (#5802) 2026-05-27 01:35:13 -07:00
release-desktop.yml Fix Windows workflow issues(#5694) 2026-05-22 05:32:30 -07:00
security-audit.yml Package scanners: cut false positives and make the CI gate blocking (#6355) 2026-06-16 01:46:15 -07:00
stale.yml CI: scope GITHUB_TOKEN permissions, add MLX CI, unblock ~60 skipped tests (#5312) 2026-05-11 03:19:13 -07:00
studio-api-smoke.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
studio-backend-ci.yml studio/setup.sh: guard empty CUDA arch detection in the source build (#5854) (#6481) 2026-06-23 01:26:43 -07:00
studio-frontend-ci.yml Frontend CI: hard-fail unreviewed npm install scripts (#6139) 2026-06-10 06:10:16 -07:00
studio-inference-smoke.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
studio-load-orchestrator-ci.yml studio: unblock /load event loop on detect_audio_type (#5642, #5635) (#5669) 2026-05-22 05:47:58 -07:00
studio-mac-api-smoke.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
studio-mac-inference-smoke.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
studio-mac-install-matrix.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
studio-mac-ui-smoke.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
studio-mac-update-smoke.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
studio-tauri-smoke.yml ci: drop cache: 'npm' from setup-node (silent abort on Windows) (#5474) 2026-05-15 20:49:05 -07:00
studio-ui-smoke.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
studio-update-smoke.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
studio-windows-api-smoke.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
studio-windows-inference-smoke.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
studio-windows-ui-smoke.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
studio-windows-update-smoke.yml Withhold HF_TOKEN from pull_request CI runs (#6600) 2026-06-23 03:59:12 -07:00
version-compat-ci.yml tests: pinned-symbol canary for unsloth-zoo save_pretrained_merged guards (#5410) (#5433) 2026-05-17 01:35:28 -07:00
wheel-smoke.yml ci: drop cache: 'npm' from setup-node (silent abort on Windows) (#5474) 2026-05-15 20:49:05 -07:00