Fix CI: Use ACCESS_TOKEN instead of FORGEJO_TOKEN to match existing secret

- Changed workflow to use ACCESS_TOKEN (your existing secret name)
- Removed extra spaces that were causing 'Bad substitution' errors
- Should now properly detect and use your ACCESS_TOKEN secret
- Fixes the upload step that was failing in Build 76
This commit is contained in:
joe 2025-08-14 09:23:29 -07:00
parent 9118e4133e
commit 5e1b60b469

View file

@ -441,15 +441,17 @@ jobs:
# Upload to Forgejo Debian Registry # Upload to Forgejo Debian Registry
# Note: This requires authentication - you'll need to set up secrets # Note: This requires authentication - you'll need to set up secrets
if [ -n "$ACCESS_TOKEN " ]; then if [ -n "$ACCESS_TOKEN" ]; then
echo " 🔐 Using authentication token..." echo " 🔐 Using authentication token..."
UPLOAD_RESULT=$(curl -s -w "%{http_code}" \ UPLOAD_RESULT=$(curl -s -w "%{http_code}" \
--user "${FORGEJO_OWNER}:${ACCESS_TOKEN }" \ --user "${FORGEJO_OWNER}:${ACCESS_TOKEN}" \
--upload-file "$deb_file" \ --upload-file "$deb_file" \
"$UPLOAD_URL" 2>/dev/null) "$UPLOAD_URL" 2>/dev/null)
HTTP_CODE="${UPLOAD_RESULT: -3}" # Extract HTTP status code (last 3 characters)
RESPONSE_BODY="${UPLOAD_RESULT%???}" HTTP_CODE=$(echo "$UPLOAD_RESULT" | tail -c 4)
# Extract response body (everything except last 3 characters)
RESPONSE_BODY=$(echo "$UPLOAD_RESULT" | head -c -4)
case $HTTP_CODE in case $HTTP_CODE in
201) 201)
@ -469,8 +471,8 @@ jobs:
;; ;;
esac esac
else else
echo " ⚠️ No ACCESS_TOKEN set - skipping upload" echo " ⚠️ No ACCESS_TOKEN set - skipping upload"
echo " 💡 Set ACCESS_TOKEN secret to enable automatic publishing" echo " 💡 Set ACCESS_TOKEN secret to enable automatic publishing"
echo " 📋 Manual upload command:" echo " 📋 Manual upload command:"
echo " curl --user your_username:your_token \\" echo " curl --user your_username:your_token \\"
echo " --upload-file $deb_file \\" echo " --upload-file $deb_file \\"