File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 505505
506506echo " 🔑 Ensuring Hugging Face authentication..."
507507
508- # In GitHub Actions, HF CLI automatically uses HF_TOKEN env var
508+ # In GitHub Actions, explicitly authenticate with token
509509if [ " $IS_GITHUB_ACTIONS " = true ]; then
510510 if [ -z " ${HF_TOKEN:- } " ]; then
511511 echo " Error: HF_TOKEN secret is required in GitHub Actions" >&2
512512 echo " Please set the HF_TOKEN secret in repository settings" >&2
513513 exit 1
514514 fi
515- echo " Using HF_TOKEN from GitHub Actions environment"
515+ echo " Authenticating with HF_TOKEN..."
516+ LOGIN_OUTPUT=$( hf auth login --token " $HF_TOKEN " 2>&1 )
517+ LOGIN_EXIT_CODE=$?
518+ if [ $LOGIN_EXIT_CODE -ne 0 ]; then
519+ echo " Error: Failed to authenticate with HF_TOKEN" >&2
520+ echo " $LOGIN_OUTPUT " >&2
521+ exit 1
522+ fi
516523elif [ -n " ${HF_TOKEN:- } " ]; then
517524 # In local environment, try to use HF_TOKEN if set
518525 hf auth login --token " $HF_TOKEN " --add-to-git-credential > /dev/null 2>&1 || true
You can’t perform that action at this time.
0 commit comments