Harden HF deploy: token via Authorization header, not URL#4
Open
Nickkoro21 wants to merge 1 commit into
Open
Conversation
The force-push embedded HF_TOKEN directly in the remote URL, exposing it in the runner's process arguments and in .git/config. Move it into an HTTP Authorization: Basic header via `git -c http.extraheader`, the same mechanism actions/checkout uses. Push target and behaviour are unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Low-severity workflow hardening from the security scan.
The
Force-push ... to Hugging Face Spacestep embeddedHF_TOKENin the remote URL (https://user:token@huggingface.co/...), which exposes it in the runner's process arguments and can persist it in.git/config. This moves the token into an HTTPAuthorization: Basicheader viagit -c http.extraheader=...— the same mechanismactions/checkoutuses internally. The push target and behaviour are otherwise identical.main, this branch won't run it. After merging, please trigger aworkflow_dispatchrun and confirm the HF Space still updates. If it fails for any reason, the previous one-line URL form can be restored.