Fix CI: Use GitHub Actions secrets syntax for ACCESS_TOKEN
Some checks failed
Comprehensive CI/CD Pipeline / Build and Test (push) Successful in 6m56s
Comprehensive CI/CD Pipeline / Security Audit (push) Failing after 6s
Comprehensive CI/CD Pipeline / Package Validation (push) Successful in 2m2s
Comprehensive CI/CD Pipeline / Status Report (push) Has been skipped

This commit is contained in:
joe 2025-08-14 10:51:31 -07:00
parent 89b462b4d0
commit 69b5f948b0

View file

@ -392,16 +392,6 @@ jobs:
run: |
echo "Publishing .deb packages to Forgejo Debian Registry..."
# Debug: Show what environment variables are available
echo "🔍 Available environment variables:"
env | grep -i token || echo "No token variables found"
env | grep -i access || echo "No access variables found"
echo "🔍 Checking specific variables:"
echo "ACCESS_TOKEN: ${ACCESS_TOKEN:-'NOT SET'}"
echo "FORGEJO_TOKEN: ${FORGEJO_TOKEN:-'NOT SET'}"
echo "GITHUB_TOKEN: ${GITHUB_TOKEN:-'NOT SET'}"
echo ""
# .deb files are MANDATORY - fail if none exist
if ! ls *.deb >/dev/null 2>&1; then
echo "⚠️ No .deb files found in current directory"
@ -449,12 +439,11 @@ jobs:
echo " Upload URL: $UPLOAD_URL"
# Upload to Forgejo Debian Registry
# Note: This requires authentication - you'll need to set up secrets
if [ -n "$ACCESS_TOKEN" ]; then
# Upload to Forgejo Debian Registry using GitHub Actions secrets syntax
if [ -n "${{ secrets.ACCESS_TOKEN }}" ]; then
echo " 🔐 Using authentication token..."
UPLOAD_RESULT=$(curl -s -w "%{http_code}" \
--user "${FORGEJO_OWNER}:${ACCESS_TOKEN}" \
--user "${FORGEJO_OWNER}:${{ secrets.ACCESS_TOKEN }}" \
--upload-file "$deb_file" \
"$UPLOAD_URL" 2>/dev/null)
@ -481,8 +470,8 @@ jobs:
;;
esac
else
echo " ⚠️ No ACCESS_TOKEN set - skipping upload"
echo " 💡 Set ACCESS_TOKEN secret to enable automatic publishing"
echo " ⚠️ No ACCESS_TOKEN secret available - skipping upload"
echo " 💡 Set ACCESS_TOKEN secret in repository settings to enable automatic publishing"
echo " 📋 Manual upload command:"
echo " curl --user your_username:your_token \\"
echo " --upload-file $deb_file \\"