fix: export Google GHA creds env var (#57)

* fix: export Google GHA creds env var

* add comments for cred envvars

* build
This commit is contained in:
Bharath KKB 2021-11-26 10:02:14 -06:00 committed by GitHub
parent 2428105372
commit 9a051ab76c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

6
dist/index.js vendored
View File

@ -240,8 +240,14 @@ function run() {
}
const credentialsPath = yield client.createCredentialsFile(runnerTempDir);
(0, core_1.setOutput)('credentials_file_path', credentialsPath);
// CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE is picked up by gcloud to use
// a specific credential file (subject to change and equivalent to auth/credential_file_override)
(0, core_1.exportVariable)('CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE', credentialsPath);
// GOOGLE_APPLICATION_CREDENTIALS is used by Application Default Credentials
// in all GCP client libraries
(0, core_1.exportVariable)('GOOGLE_APPLICATION_CREDENTIALS', credentialsPath);
// GOOGLE_GHA_CREDS_PATH is used by other Google GitHub Actions
(0, core_1.exportVariable)('GOOGLE_GHA_CREDS_PATH', credentialsPath);
}
// Set the project ID environment variables to the computed values.
const computedProjectID = yield client.getProjectID();

View File

@ -88,8 +88,14 @@ async function run(): Promise<void> {
const credentialsPath = await client.createCredentialsFile(runnerTempDir);
setOutput('credentials_file_path', credentialsPath);
// CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE is picked up by gcloud to use
// a specific credential file (subject to change and equivalent to auth/credential_file_override)
exportVariable('CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE', credentialsPath);
// GOOGLE_APPLICATION_CREDENTIALS is used by Application Default Credentials
// in all GCP client libraries
exportVariable('GOOGLE_APPLICATION_CREDENTIALS', credentialsPath);
// GOOGLE_GHA_CREDS_PATH is used by other Google GitHub Actions
exportVariable('GOOGLE_GHA_CREDS_PATH', credentialsPath);
}
// Set the project ID environment variables to the computed values.