Skip to content

Commit 693d553

Browse files
authored
Default "promote" to true (#362)
This restores a v0 and v1 behavior wherein the empty string is considered "true" instead of "false". Fixes GH-361.
1 parent f53a32b commit 693d553

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export async function run(): Promise<void> {
9393
const envVars = parseKVString(getInput('env_vars'));
9494
const imageUrl = presence(getInput('image_url'));
9595
const version = presence(getInput('version'));
96-
const promote = parseBoolean(getInput('promote'));
96+
const promote = parseBoolean(getInput('promote'), true);
9797
const flags = presence(getInput('flags'));
9898
const gcloudVersion = await computeGcloudVersion(getInput('gcloud_version'));
9999
const gcloudComponent = presence(getInput('gcloud_component'));

tests/main.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,16 @@ test('#run', { concurrency: true }, async (suite) => {
229229
assertMembers(mocks.getExecOutput.mock.calls?.at(0)?.arguments?.at(1), ['--promote']);
230230
});
231231

232+
await suite.test('sets promote if given the empty string', async (t) => {
233+
const mocks = defaultMocks(t.mock, {
234+
promote: '',
235+
});
236+
237+
await run();
238+
239+
assertMembers(mocks.getExecOutput.mock.calls?.at(0)?.arguments?.at(1), ['--promote']);
240+
});
241+
232242
await suite.test('sets no-promote if given', async (t) => {
233243
const mocks = defaultMocks(t.mock, {
234244
promote: 'false',

0 commit comments

Comments
 (0)