Skip to content

Commit 7e9f2f2

Browse files
authored
Disable prompts (#510)
Closes #509
1 parent 0116569 commit 7e9f2f2

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

dist/main/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import {
3838
parseKVStringAndFile,
3939
pinnedToHeadWarning,
4040
presence,
41-
stubEnv,
4241
} from '@google-github-actions/actions-utils';
4342
import {
4443
authenticateGcloudSDK,
@@ -81,10 +80,9 @@ enum ResponseTypes {
8180
*/
8281
export async function run(): Promise<void> {
8382
// Register metrics
84-
const restoreEnv = stubEnv({
85-
CLOUDSDK_METRICS_ENVIRONMENT: 'github-actions-deploy-cloudrun',
86-
CLOUDSDK_METRICS_ENVIRONMENT_VERSION: appVersion,
87-
});
83+
process.env.CLOUDSDK_CORE_DISABLE_PROMPTS = '1';
84+
process.env.CLOUDSDK_METRICS_ENVIRONMENT = 'github-actions-deploy-cloudrun';
85+
process.env.CLOUDSDK_METRICS_ENVIRONMENT_VERSION = appVersion;
8886

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

195-
cmd = ['run', 'jobs', 'deploy', job, '--quiet'];
193+
cmd = ['run', 'jobs', 'deploy', job];
196194

197195
if (image) {
198196
cmd.push('--image', image);
@@ -216,7 +214,7 @@ export async function run(): Promise<void> {
216214
cmd.push('--labels', joinKVStringForGCloud(compiledLabels));
217215
}
218216
} else {
219-
cmd = ['run', 'deploy', service, '--quiet'];
217+
cmd = ['run', 'deploy', service];
220218

221219
if (image) {
222220
cmd.push('--image', image);
@@ -315,8 +313,6 @@ export async function run(): Promise<void> {
315313
} catch (err) {
316314
const msg = errorMessage(err);
317315
setFailed(`google-github-actions/deploy-cloudrun failed with: ${msg}`);
318-
} finally {
319-
restoreEnv();
320316
}
321317
}
322318

0 commit comments

Comments
 (0)