Skip to content

Commit 6e4b1a5

Browse files
committed
ci: update GitHub Actions workflow secret handling
Refactor environment variable injection to use explicit env contexts for improved security and reliability when configuring API keys and keystores.
1 parent 499b736 commit 6e4b1a5

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/android.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,23 @@ jobs:
2525
uses: gradle/actions/setup-gradle@v3
2626

2727
- name: Create .env File
28+
env:
29+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
2830
run: |
2931
touch .env
30-
if [ -n "${{ secrets.GEMINI_API_KEY }}" ]; then
31-
echo "GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY }}" >> .env
32+
if [ -n "$GEMINI_API_KEY" ]; then
33+
echo "GEMINI_API_KEY=$GEMINI_API_KEY" >> .env
3234
else
3335
echo "GEMINI_API_KEY=placeholder_key" >> .env
3436
fi
3537
3638
- name: Decode Keystore
37-
if: ${{ secrets.KEYSTORE_BASE64 != '' }}
39+
env:
40+
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
3841
run: |
39-
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > release.keystore
42+
if [ -n "$KEYSTORE_BASE64" ]; then
43+
echo "$KEYSTORE_BASE64" | base64 -d > release.keystore
44+
fi
4045
4146
- name: Grant Execute Permissions
4247
run: |

0 commit comments

Comments
 (0)