From 6b5e19b1def789ffc72364771919a8619cafe073 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Fri, 18 Apr 2025 10:53:02 -0400 Subject: [PATCH] [no ci] update secret decode tool --- .github/actions/decrypt.sh | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/.github/actions/decrypt.sh b/.github/actions/decrypt.sh index 3008fc8e..96646660 100755 --- a/.github/actions/decrypt.sh +++ b/.github/actions/decrypt.sh @@ -1,38 +1,11 @@ #!/bin/sh -credspath="$3" +credspath="$1" if [ ! -d "$credspath" ]; then echo "creating ${credspath}" mkdir -p "$credspath" fi -gpgfile="$1" -if [ -f "$gpgfile" ]; then - echo "source file is ${gpgfile}" -else - echo "ERROR: ${gpgfile} does not exist" - exit 1 -fi -credsfile="$2" -echo "target file is ${credsfile}" -if [ -z ${PASSCODE+x} ]; then - echo "ERROR: PASSCODE is unset"; - exit 2 -else - echo "PASSCODE is set"; -fi -gpg --batch \ - --yes \ - --decrypt \ - --passphrase="$PASSCODE" \ - --output "$credsfile" \ - "$gpgfile" +secretvar="GAM_GHA_${JID}" +secretval="${!secretvar}" -if [[ "$RUNNER_OS" == "macOS" ]]; then - tar="gtar" -else - tar="tar" -fi - -"$tar" xlvvf "$credsfile" --directory "$credspath" -rm -rvf "$gpgfile" -rm -rvf "$credsfile" +echo -e "$secretval" > "${credspath}/oauth2.txt"