fix(release): tolerate stray % and whitespace in keystore base64 secret#16
Merged
Conversation
…tore Agent-Logs-Url: https://github.com/LookAtWhatAiCanDo/EXIFiler/sessions/80f0fa00-770b-4a0c-a17f-6e84d8f60876 Co-authored-by: paulpv <1393897+paulpv@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
zsh appends a
%(PROMPT_EOL_MARK) when command output has no trailing newline. Runningbase64 -i exifiler-release.keystore | tr -d '\n'produces exactly this, so the%gets silently included when copying from the terminal — causingbase64: invalid inputin CI.Change
Swap the whitespace-only strip for a base64-alphabet allowlist:
tr -dc 'A-Za-z0-9+/='discards every character outside the base64 alphabet (%, CRLFs, spaces) without requiring the secret to be recreated.