Skip to content

Commit

Permalink
fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
saperi22 committed Sep 10, 2024
1 parent f43e9f3 commit 6fdd618
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 4 additions & 6 deletions .github/executables/decrypt_secret.sh
Original file line number Diff line number Diff line change
@@ -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" \
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/firebase_deploy_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6fdd618

Please sign in to comment.