Skip to content

Fix: KEYSTORE_BASE64 invalid input in GitHub Actions #1

Description

@SayanthRock

Problem

GitHub Actions fails at Validate release keystore step with:

base64: invalid input

Root Cause

The KEYSTORE_BASE64 secret is corrupted:

  • Contains line breaks / whitespace
  • Incorrect encoding
  • Extra characters injected during manual creation

Fix (Verified Working)

1. Recreate keystore

keytool -genkeypair \
-keystore release-keystore.jks \
-storetype PKCS12 \
-keyalg RSA \
-keysize 2048 \
-validity 10000 \
-alias freeairock

2. Encode clean (no line breaks)

base64 release-keystore.jks | tr -d '\n' > clean.txt

3. Verify locally

base64 -d clean.txt > test.jks
keytool -list -keystore test.jks

4. Upload secret via CLI (recommended)

gh secret set KEYSTORE_BASE64 -R SayanthRock/FREE-AI-ROCK- < clean.txt

5. Workflow step (safe version)

- name: Validate release keystore
  run: |
    echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > release-keystore.jks
    keytool -list -keystore release-keystore.jks \
      -storepass "${{ secrets.STORE_PASSWORD }}" \
      -alias "${{ secrets.KEY_ALIAS }}" \
      -storetype PKCS12

Expected Result

  • Validate release keystore ✅
  • Sign APK ✅
  • Release pipeline success ✅

Notes

Do NOT:

  • Copy paste base64 manually
  • Use multi-line base64
  • Edit encoded string

This issue tracks fixing the corrupted Base64 secret blocking release builds.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions