From 5e1b60b469ad8945c4bf29d2cbbaa2c006accded Mon Sep 17 00:00:00 2001 From: joe Date: Thu, 14 Aug 2025 09:23:29 -0700 Subject: [PATCH] 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 --- .forgejo/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 61844346..2375db95 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -441,15 +441,17 @@ jobs: # Upload to Forgejo Debian Registry # 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..." UPLOAD_RESULT=$(curl -s -w "%{http_code}" \ - --user "${FORGEJO_OWNER}:${ACCESS_TOKEN }" \ + --user "${FORGEJO_OWNER}:${ACCESS_TOKEN}" \ --upload-file "$deb_file" \ "$UPLOAD_URL" 2>/dev/null) - HTTP_CODE="${UPLOAD_RESULT: -3}" - RESPONSE_BODY="${UPLOAD_RESULT%???}" + # Extract HTTP status code (last 3 characters) + 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 201) @@ -469,8 +471,8 @@ jobs: ;; esac else - echo " ⚠️ No ACCESS_TOKEN set - skipping upload" - echo " 💡 Set ACCESS_TOKEN secret to enable automatic publishing" + echo " ⚠️ No ACCESS_TOKEN set - skipping upload" + echo " 💡 Set ACCESS_TOKEN secret to enable automatic publishing" echo " 📋 Manual upload command:" echo " curl --user your_username:your_token \\" echo " --upload-file $deb_file \\"