Skip to content

fix(release): tolerate stray % and whitespace in keystore base64 secret#16

Merged
paulpv merged 1 commit into
mainfrom
copilot/fix-base64-invalid-input
May 2, 2026
Merged

fix(release): tolerate stray % and whitespace in keystore base64 secret#16
paulpv merged 1 commit into
mainfrom
copilot/fix-base64-invalid-input

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 2, 2026

zsh appends a % (PROMPT_EOL_MARK) when command output has no trailing newline. Running base64 -i exifiler-release.keystore | tr -d '\n' produces exactly this, so the % gets silently included when copying from the terminal — causing base64: invalid input in CI.

Change

Swap the whitespace-only strip for a base64-alphabet allowlist:

# before
echo "$KEYSTORE_B64" | tr -d '[:space:]' | base64 --decode

# after
echo "$KEYSTORE_B64" | tr -dc 'A-Za-z0-9+/=' | base64 --decode

tr -dc 'A-Za-z0-9+/=' discards every character outside the base64 alphabet (%, CRLFs, spaces) without requiring the secret to be recreated.

@paulpv paulpv marked this pull request as ready for review May 2, 2026 01:37
Copilot AI review requested due to automatic review settings May 2, 2026 01:37
@paulpv paulpv merged commit 22a67e8 into main May 2, 2026
3 checks passed
@paulpv paulpv deleted the copilot/fix-base64-invalid-input branch May 2, 2026 01:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves the GitHub Actions release workflow’s robustness when decoding the Android release keystore from a base64-encoded secret, specifically addressing stray terminal characters (e.g., zsh PROMPT_EOL_MARK %) during copy/paste.

Changes:

  • Replace whitespace stripping with a base64-alphabet allowlist before decoding the keystore secret.

exit 1
fi
echo "$KEYSTORE_B64" | tr -d '[:space:]' | base64 --decode > "${{ runner.temp }}/release.keystore"
echo "$KEYSTORE_B64" | tr -dc 'A-Za-z0-9+/=' | base64 --decode > "${{ runner.temp }}/release.keystore"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants