Skip to content

Commit 62f8bdc

Browse files
committed
Pass release secrets via env vars, not inline YAML interpolation
Splicing multi-line secrets directly into a run: script via \${{ secrets.X }} can mangle the bytes; env vars preserve them exactly. Also adds a sanity check that the decoded keystore is a binary file, not corrupted text, to fail fast with a clear error next time instead of a cryptic ASN.1 exception.
1 parent f96a5bc commit 62f8bdc

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,24 @@ jobs:
2525
uses: android-actions/setup-android@v3
2626

2727
- name: Decode keystore
28-
run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > release.jks
28+
env:
29+
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
30+
run: |
31+
echo "$KEYSTORE_BASE64" | base64 -d > release.jks
32+
# Sanity check: a valid PKCS12/JKS keystore is a binary file, never plain text.
33+
file release.jks
34+
test -s release.jks
2935
3036
- name: Write key.properties
37+
env:
38+
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
39+
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
40+
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
3141
run: |
3242
cat > key.properties <<EOF
33-
storePassword=${{ secrets.KEYSTORE_PASSWORD }}
34-
keyPassword=${{ secrets.KEY_PASSWORD }}
35-
keyAlias=${{ secrets.KEY_ALIAS }}
43+
storePassword=$KEYSTORE_PASSWORD
44+
keyPassword=$KEY_PASSWORD
45+
keyAlias=$KEY_ALIAS
3646
storeFile=../release.jks
3747
EOF
3848

0 commit comments

Comments
 (0)