Spaces:
Sleeping
Sleeping
Debug Hugging Face token
Browse files21 unmodified lines22232425262728293031323334353637383921 unmodified linesHF_TOKEN: ${{ secrets.HF_TOKEN }}run: |python - <<'PY'import os, urllib.requesttoken = os.environ["HF_TOKEN"]req = urllib.request.Request("https://huggingface.co/api/whoami-v2",headers={"Authorization": f"Bearer {token}"})print(urllib.request.urlopen(req).read().decode())PY- name: Push refactor branch to Hugging Face Spaceenv:HF_TOKEN: ${{ secrets.HF_TOKEN }}run: |git remote add hf https://hf_user:${HF_TOKEN}@huggingface.co/spaces/wepee/CAPS04-FE-REFACTORgit push hf HEAD:main --force21 unmodified lines22232425262728293031323334353637383940414243444546474849505121 unmodified linesHF_TOKEN: ${{ secrets.HF_TOKEN }}run: |python - <<'PY'import os, urllib.request, jsontoken = os.environ.get("HF_TOKEN", "")print("Token exists:", bool(token))print("Token length:", len(token))req = urllib.request.Request("https://huggingface.co/api/whoami-v2",headers={"Authorization": f"Bearer {token}"})try:res = urllib.request.urlopen(req)data = json.loads(res.read().decode())print("HF user:", data.get("name"))print("HF auth:", data)except Exception as e:print("TOKEN CHECK FAILED:", repr(e))raisePY- name: Push refactor branch to Hugging Face Spaceenv:HF_TOKEN: ${{ secrets.HF_TOKEN }}run: |git remote add hf https://wepee:${HF_TOKEN}@huggingface.co/spaces/wepee/CAPS04-FE-REFACTORgit push hf HEAD:main --force
.github/workflows/deploy-huggingface.yml+16-4