Skip to content

Commit e2948b7

Browse files
committed
ci(android): the workflow never parsed — secrets are not readable in a step's if; go through env
Every run since the workflow was added failed before any job started. actionlint now passes; the keystore step and the release attach test env.KEYSTORE_B64.
1 parent 544fa7f commit e2948b7

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎.github/workflows/android.yml‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
defaults:
2929
run:
3030
working-directory: android
31+
env:
32+
# the secrets context cannot be read in a step's `if`; an env value can
33+
KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }}
3134
steps:
3235
- uses: actions/checkout@v7
3336

@@ -39,9 +42,7 @@ jobs:
3942
- uses: gradle/actions/setup-gradle@v5
4043

4144
- name: Release keystore
42-
if: ${{ secrets.ANDROID_KEYSTORE_B64 != '' }}
43-
env:
44-
KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }}
45+
if: env.KEYSTORE_B64 != ''
4546
run: |
4647
echo "$KEYSTORE_B64" | base64 -d > "$RUNNER_TEMP/release.jks"
4748
{
@@ -84,7 +85,7 @@ jobs:
8485
# the secrets the APK is a workflow artifact and the maintainer attaches the one built
8586
# with the key kept outside the repository (docs/android.md).
8687
- name: Attach to the release
87-
if: startsWith(github.ref, 'refs/tags/v') && secrets.ANDROID_KEYSTORE_B64 != ''
88+
if: startsWith(github.ref, 'refs/tags/v') && env.KEYSTORE_B64 != ''
8889
uses: softprops/action-gh-release@v2
8990
with:
9091
files: |

0 commit comments

Comments
 (0)