Skip to content

Commit 0f5f162

Browse files
thompsonsonclaude
andcommitted
fix: correct HF authentication format with configurable token name
- Fix git URL to use correct Hugging Face authentication format - Add HF_TOKEN_NAME environment variable for token name configuration - Use token name instead of username for git authentication - Update instructions to include token name configuration - Should resolve authentication failed error in deployment 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent eb818c1 commit 0f5f162

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Deploy to Hugging Face Spaces
44
# 1. Create a Hugging Face account and create a Space at https://hf.co/new-space
55
# 2. Get your HF token from https://hf.co/settings/tokens (with write access)
66
# 3. Add HF_TOKEN as a repository secret in GitHub Settings > Secrets and variables > Actions
7-
# 4. Update the environment variables below with your HF username and space name
7+
# 4. Update the environment variables below with your HF username, space name, and token name
88

99
on:
1010
workflow_run:
@@ -17,6 +17,7 @@ on:
1717
env:
1818
HF_USERNAME: "thompsonson"
1919
HF_SPACE_NAME: "bayesian_game"
20+
HF_TOKEN_NAME: "bayesian_game"
2021

2122
jobs:
2223
deploy:
@@ -39,5 +40,5 @@ jobs:
3940
fi
4041
git config --global user.email "[email protected]"
4142
git config --global user.name "GitHub Action"
42-
git remote add hf https://${{ env.HF_USERNAME }}:$HF_TOKEN@hf.co/spaces/${{ env.HF_USERNAME }}/${{ env.HF_SPACE_NAME }}
43+
git remote add hf https://${{ env.HF_TOKEN_NAME }}:$HF_TOKEN@huggingface.co/spaces/${{ env.HF_USERNAME }}/${{ env.HF_SPACE_NAME }}
4344
git push hf main --force

0 commit comments

Comments
 (0)