This commit is contained in:
@@ -56,16 +56,16 @@ jobs:
|
|||||||
cd "$GITHUB_WORKSPACE"
|
cd "$GITHUB_WORKSPACE"
|
||||||
git init .
|
git init .
|
||||||
|
|
||||||
# 优先使用 secrets.token (USER_TOKEN)
|
# 优先使用 secrets.GITHUB_TOKEN (TOKEN)
|
||||||
AUTH_TOKEN="$TOKEN"
|
AUTH_TOKEN="$TOKEN"
|
||||||
USE_BASIC_AUTH="false"
|
USE_BASIC_AUTH="false"
|
||||||
|
|
||||||
if [ -n "$USER_TOKEN" ]; then
|
if [ -n "$TOKEN" ]; then
|
||||||
|
echo "Using secrets.GITHUB_TOKEN for authentication (Bearer Header)."
|
||||||
|
elif [ -n "$USER_TOKEN" ]; then
|
||||||
AUTH_TOKEN="$USER_TOKEN"
|
AUTH_TOKEN="$USER_TOKEN"
|
||||||
USE_BASIC_AUTH="true"
|
USE_BASIC_AUTH="true"
|
||||||
echo "Using secrets.token for authentication (Basic Auth)."
|
echo "Using secrets.token for authentication (Basic Auth)."
|
||||||
elif [ -n "$TOKEN" ]; then
|
|
||||||
echo "Using secrets.GITHUB_TOKEN for authentication (Bearer Header)."
|
|
||||||
else
|
else
|
||||||
echo "Warning: No token found. Attempting unauthenticated fetch (will fail for private repos)."
|
echo "Warning: No token found. Attempting unauthenticated fetch (will fail for private repos)."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user