From b445680baee075df9fa553185566585779355ec5 Mon Sep 17 00:00:00 2001 From: Anthony Dade <145477058+AnthonyDadeWT@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:10:31 -0500 Subject: [PATCH] Fix/race condition Issue #55 (#58) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add check for FIREBASE_TOKEN existence (#48) Warn when both token (either as input or environment variable) and service credentials are defined at the same time * Addressing race condition * adding ID print so I know * removing print * Update enviornment var when using URL --------- Co-authored-by: Karol Wrótniak --- step.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/step.sh b/step.sh index 299584e..63325a2 100755 --- a/step.sh +++ b/step.sh @@ -119,6 +119,11 @@ echo_details "* upgrade_firebase_tools: $upgrade_firebase_tools" echo +# Export Service Credentials File +if [ -n "${service_credentials_file}" ] ; then + export GOOGLE_APPLICATION_CREDENTIALS="${service_credentials_file}" +fi + if [ -z "${app_path}" ] ; then echo_fail "App path for APK, AAB or IPA is not defined" fi @@ -161,6 +166,7 @@ if [ -z "${firebase_token}" ] ; then echo_info "Service Credentials File is a remote url, downloading it ..." curl $service_credentials_file --output credentials.json service_credentials_file=$(pwd)/credentials.json + export GOOGLE_APPLICATION_CREDENTIALS="${service_credentials_file}" echo_info "Downloaded Service Credentials File to path: ${service_credentials_file}" else echo_fail "Service Credentials File defined but does not exist at path: ${service_credentials_file}" @@ -196,11 +202,6 @@ else curl -sL firebase.tools | bash fi -# Export Service Credentials File -if [ -n "${service_credentials_file}" ] ; then - export GOOGLE_APPLICATION_CREDENTIALS="${service_credentials_file}" -fi - # Deploy echo_info "Deploying build to Firebase"