thompsonson Claude commited on
Commit
0f5f162
·
1 Parent(s): eb818c1

fix: correct HF authentication format with configurable token name

Browse files

- 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 <noreply@anthropic.com>

Files changed (1) hide show
  1. .github/workflows/deploy.yml +3 -2
.github/workflows/deploy.yml CHANGED
@@ -4,7 +4,7 @@ name: Deploy to Hugging Face Spaces
4
  # 1. Create a Hugging Face account and create a Space at https://hf.co/new-space
5
  # 2. Get your HF token from https://hf.co/settings/tokens (with write access)
6
  # 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
8
 
9
  on:
10
  workflow_run:
@@ -17,6 +17,7 @@ on:
17
  env:
18
  HF_USERNAME: "thompsonson"
19
  HF_SPACE_NAME: "bayesian_game"
 
20
 
21
  jobs:
22
  deploy:
@@ -39,5 +40,5 @@ jobs:
39
  fi
40
  git config --global user.email "action@github.com"
41
  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 push hf main --force
 
4
  # 1. Create a Hugging Face account and create a Space at https://hf.co/new-space
5
  # 2. Get your HF token from https://hf.co/settings/tokens (with write access)
6
  # 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, space name, and token name
8
 
9
  on:
10
  workflow_run:
 
17
  env:
18
  HF_USERNAME: "thompsonson"
19
  HF_SPACE_NAME: "bayesian_game"
20
+ HF_TOKEN_NAME: "bayesian_game"
21
 
22
  jobs:
23
  deploy:
 
40
  fi
41
  git config --global user.email "action@github.com"
42
  git config --global user.name "GitHub Action"
43
+ git remote add hf https://${{ env.HF_TOKEN_NAME }}:$HF_TOKEN@huggingface.co/spaces/${{ env.HF_USERNAME }}/${{ env.HF_SPACE_NAME }}
44
  git push hf main --force