Skip to content

Commit d842424

Browse files
authored
chore: make opening the actor build results in push opt-in (#881)
BREAKING CHANGE: the `--no-prompt` flag in `apify push` has been replaced with `--open`. Provide this flag if you want the CLI to automatically open the Actor details.
1 parent 7f391f8 commit d842424

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

features/test-implementations/1.setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ Given<TestWorld>(/the local actor is pushed to the Apify platform/i, { timeout:
234234
}
235235

236236
const result = await executeCommand({
237-
rawCommand: 'apify push --no-prompt',
237+
rawCommand: 'apify push',
238238
cwd: this.testActor.pwd,
239239
env: extraEnv,
240240
});

src/commands/actors/push.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { join, resolve } from 'node:path';
33
import process from 'node:process';
44

55
import type { Actor, ActorCollectionCreateOptions, ActorDefaultRunOptions } from 'apify-client';
6-
import isCI from 'is-ci';
76
import open from 'open';
87

98
import { fetchManifest } from '@apify/actor-templates';
@@ -15,7 +14,6 @@ import { Flags } from '../../lib/command-framework/flags.js';
1514
import { CommandExitCodes, DEPRECATED_LOCAL_CONFIG_NAME, LOCAL_CONFIG_PATH } from '../../lib/consts.js';
1615
import { sumFilesSizeInBytes } from '../../lib/files.js';
1716
import { useActorConfig } from '../../lib/hooks/useActorConfig.js';
18-
import { useYesNoConfirm } from '../../lib/hooks/user-confirmations/useYesNoConfirm.js';
1917
import { error, info, link, run, success, warning } from '../../lib/outputs.js';
2018
import { transformEnvToEnvVars } from '../../lib/secrets.js';
2119
import {
@@ -66,9 +64,8 @@ export class ActorsPushCommand extends ApifyCommand<typeof ActorsPushCommand> {
6664
description: 'Seconds for waiting to build to finish, if no value passed, it waits forever.',
6765
required: false,
6866
}),
69-
'no-prompt': Flags.boolean({
70-
description:
71-
'Do not prompt for opening the Actor details in a browser. This will also not open the browser automatically.',
67+
'open': Flags.boolean({
68+
description: 'Whether to open the browser automatically to the Actor details page.',
7269
default: false,
7370
required: false,
7471
}),
@@ -311,15 +308,13 @@ Skipping push. Use --force to override.`,
311308
url: `https://console.apify.com${redirectUrlPart}/actors/${build.actId}#/builds/${build.buildNumber}`,
312309
});
313310

314-
// Disable open browser on CI, or if user passed --no-prompt flag
315-
if (!isCI && !this.flags.noPrompt) {
316-
const shouldOpenBrowser = await useYesNoConfirm({
317-
message: 'Do you want to open the Actor detail in your browser?',
318-
});
311+
link({
312+
message: 'Actor detail',
313+
url: `https://console.apify.com${redirectUrlPart}/actors/${build.actId}`,
314+
});
319315

320-
if (shouldOpenBrowser) {
321-
await open(`https://console.apify.com${redirectUrlPart}/actors/${build.actId}`);
322-
}
316+
if (this.flags.open) {
317+
await open(`https://console.apify.com${redirectUrlPart}/actors/${build.actId}`);
323318
}
324319

325320
if (build.status === ACTOR_JOB_STATUSES.SUCCEEDED) {

src/lib/hooks/user-confirmations/useMaskedInput.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface UseMaskedInputInput {
88
}
99

1010
export const useMaskedInput = stdinCheckWrapper(async ({ message, mask }: UseMaskedInputInput) => {
11-
const result = await password({ message, mask });
11+
const result = await password({ message, mask: mask ?? '*' });
1212

1313
return result;
1414
});

0 commit comments

Comments
 (0)