Skip to content

Commit

Permalink
Disable prompts (#510)
Browse files Browse the repository at this point in the history
Closes
#509
  • Loading branch information
sethvargo authored May 1, 2024
1 parent 0116569 commit 7e9f2f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/main/index.js

Large diffs are not rendered by default.

14 changes: 5 additions & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import {
parseKVStringAndFile,
pinnedToHeadWarning,
presence,
stubEnv,
} from '@google-github-actions/actions-utils';
import {
authenticateGcloudSDK,
Expand Down Expand Up @@ -81,10 +80,9 @@ enum ResponseTypes {
*/
export async function run(): Promise<void> {
// Register metrics
const restoreEnv = stubEnv({
CLOUDSDK_METRICS_ENVIRONMENT: 'github-actions-deploy-cloudrun',
CLOUDSDK_METRICS_ENVIRONMENT_VERSION: appVersion,
});
process.env.CLOUDSDK_CORE_DISABLE_PROMPTS = '1';
process.env.CLOUDSDK_METRICS_ENVIRONMENT = 'github-actions-deploy-cloudrun';
process.env.CLOUDSDK_METRICS_ENVIRONMENT_VERSION = appVersion;

// Warn if pinned to HEAD
if (isPinnedToHead()) {
Expand Down Expand Up @@ -192,7 +190,7 @@ export async function run(): Promise<void> {
`not covered by the semver backwards compatibility guarantee.`,
);

cmd = ['run', 'jobs', 'deploy', job, '--quiet'];
cmd = ['run', 'jobs', 'deploy', job];

if (image) {
cmd.push('--image', image);
Expand All @@ -216,7 +214,7 @@ export async function run(): Promise<void> {
cmd.push('--labels', joinKVStringForGCloud(compiledLabels));
}
} else {
cmd = ['run', 'deploy', service, '--quiet'];
cmd = ['run', 'deploy', service];

if (image) {
cmd.push('--image', image);
Expand Down Expand Up @@ -315,8 +313,6 @@ export async function run(): Promise<void> {
} catch (err) {
const msg = errorMessage(err);
setFailed(`google-github-actions/deploy-cloudrun failed with: ${msg}`);
} finally {
restoreEnv();
}
}

Expand Down

0 comments on commit 7e9f2f2

Please sign in to comment.