From 6fdd6184595f4550030bcaf36f63a487a6ead24d Mon Sep 17 00:00:00 2001 From: Sai Date: Tue, 10 Sep 2024 12:26:09 -0500 Subject: [PATCH] fix script --- .github/executables/decrypt_secret.sh | 10 ++++------ .github/workflows/firebase_deploy_preview.yml | 8 +++++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/executables/decrypt_secret.sh b/.github/executables/decrypt_secret.sh index 4450862403..58698cb145 100755 --- a/.github/executables/decrypt_secret.sh +++ b/.github/executables/decrypt_secret.sh @@ -1,20 +1,18 @@ #!/bin/sh # Get arguments -while getopts passphrase:input:output: flag +while getopts p:i:o: flag do case "${flag}" in - passphrase) passphrase=${OPTARG};; - input) input=${OPTARG};; - output) output=${OPTARG};; + p) passphrase=${OPTARG};; + i) input=${OPTARG};; + o) output=${OPTARG};; esac done echo "Passphrase: $passphrase"; echo "Input: $input"; echo "Output: $output"; -# Decrypt the file -mkdir $HOME/secrets # --batch to prevent interactive command # --yes to assume "yes" for questions gpg --quiet --batch --yes --decrypt --passphrase="$passphrase" \ diff --git a/.github/workflows/firebase_deploy_preview.yml b/.github/workflows/firebase_deploy_preview.yml index b027417b60..7c5bcf6248 100644 --- a/.github/workflows/firebase_deploy_preview.yml +++ b/.github/workflows/firebase_deploy_preview.yml @@ -15,11 +15,13 @@ jobs: uses: ./.github/actions/setup - name: Assemble run: ./gradlew --stacktrace :demo:assembleRelease + - name: Create directory to store secrets + run: mkdir $HOME/secrets - name: Decrypt large secret run: ./.github/executables/decrypt_secret.sh \ - -passphrase $LARGE_SECRET_PASSPHRASE \ - -input ./.github/files/braintree-demo-app-eb501d54ba5f.json.gpg \ - -output $HOME/secrets/braintree_demo_app-eb501d54ba5f.json + -p $LARGE_SECRET_PASSPHRASE \ + -i ./.github/files/braintree-demo-app-eb501d54ba5f.json.gpg \ + -o $HOME/secrets/braintree_demo_app-eb501d54ba5f.json env: LARGE_SECRET_PASSPHRASE: ${{ secrets.FIREBASE_PRIVATE_KEY_GPG_PASSPHRASE }} # - name: Deploy to Firebase