From d3cf742bd52c4d17de2f287a2ae82b1c3952f37c Mon Sep 17 00:00:00 2001 From: google-github-actions-bot <72759630+google-github-actions-bot@users.noreply.github.com> Date: Mon, 6 Dec 2021 14:21:19 -0600 Subject: [PATCH] chore: build dist (#424) --- dist/main/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/main/index.js b/dist/main/index.js index b3f9a6540..e19f214d2 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -9696,7 +9696,7 @@ function isWIFCredFile(credFile) { /** * Authenticates the gcloud tool using a service account key or WIF credential configuration * discovered via GOOGLE_GHA_CREDS_PATH environment variable. An optional serviceAccountKey - * param is supported for legacy Actions. + * param is supported for legacy Actions and will take precedence over GOOGLE_GHA_CREDS_PATH. * * @param serviceAccountKey - The service account key used for authentication. * @param silent - Skip writing output to sdout. @@ -9704,6 +9704,10 @@ function isWIFCredFile(credFile) { */ function authenticateGcloudSDK(serviceAccountKey, silent = true) { return __awaiter(this, void 0, void 0, function* () { + // Support legacy actions that pass in SA key + if (serviceAccountKey) { + return authGcloudSAKey(serviceAccountKey, silent); + } // Check if GOOGLE_GHA_CREDS_PATH has been set by auth if (process.env.GOOGLE_GHA_CREDS_PATH) { const credFilePath = process.env.GOOGLE_GHA_CREDS_PATH; @@ -9714,10 +9718,6 @@ function authenticateGcloudSDK(serviceAccountKey, silent = true) { } return authGcloudSAKey(credFile, silent); } - // Support legacy actions that pass in SA key - if (serviceAccountKey) { - return authGcloudSAKey(serviceAccountKey, silent); - } // One of GOOGLE_GHA_CREDS_PATH or SA key is required throw new Error('Error authenticating the Cloud SDK. Please use `google-github-actions/auth` to export credentials.'); });