From 516b1b2bac98d85d2db1d6fae5c856f673ef39e1 Mon Sep 17 00:00:00 2001 From: charlie mangano Date: Mon, 11 Nov 2024 11:47:44 +0100 Subject: [PATCH] ci: add secret.properties setup to handle secrets in `ci` workflow This fetches the secrets from GitHub Secrets and pastes them into the template file `secrets.defaults.properties`. This file is then copied over to a `secrets.properties` created in the CI. This ensures proper and secure secrets handling. --- .github/workflows/ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f34d8ee2..d2c8d5d16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,6 +87,19 @@ jobs: run: | chmod +x ./gradlew + - name: Setup secrets.properties + env: + SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} + SERVICE_KEY: ${{ secrets.SERVICE_KEY }} + SUPABASE_URL: ${{ secrets.SUPABASE_URL }} + POWERSYNC_URL: ${{ secrets.POWERSYNC_URL }} + run: | + sed -e "s|SAFE_DEFAULT_VALUE_SERVICE_KEY|$SERVICE_KEY|g;" \ + -e "s|SAFE_DEFAULT_VALUE_SUPABASE_KEY|$SUPABASE_KEY|g;" \ + -e "s|SAFE_DEFAULT_VALUE_SUPABASE_URL|$SUPABASE_URL|g;" \ + -e "s|SAFE_DEFAULT_VALUE_POWERSYNC_URL|$POWERSYNC_URL|g;" secrets.defaults.properties > secrets.properties + + # Check formatting - name: KTFmt Check run: |