Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/commands/actors/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,25 @@ export class ActorsPushCommand extends ApifyCommand<typeof ActorsPushCommand> {
default: false,
required: false,
}),
// Aliases for --force. Agents frequently confabulate npm/apt-style skip-confirmation flags
// (--yes, -y, --no-prompt, --no-interactive) instead of Apify's --force. Accept them all so
// the command does what the user obviously meant rather than failing with "Unknown flag".
yes: Flags.boolean({
char: 'y',
description: 'Alias for --force. Accepted so npm/apt-style `--yes` / `-y` work with `apify push`.',
default: false,
required: false,
}),
'no-prompt': Flags.boolean({
description: 'Alias for --force. Accepted so `--no-prompt` works with `apify push`.',
default: false,
required: false,
}),
'no-interactive': Flags.boolean({
description: 'Alias for --force. Accepted so `--no-interactive` works with `apify push`.',
default: false,
required: false,
}),
dir: Flags.string({
description: 'Directory where the Actor is located.',
required: false,
Expand Down Expand Up @@ -346,8 +365,12 @@ export class ActorsPushCommand extends ApifyCommand<typeof ActorsPushCommand> {
}, 0);
const actorModifiedMs = client?.modifiedAt.valueOf();

// npm/apt-style skip-confirmation flags are treated as aliases for --force.
const skipStalenessCheck =
this.flags.force || this.flags.yes || this.flags.noPrompt || this.flags.noInteractive;

if (
!this.flags.force &&
!skipStalenessCheck &&
actorModifiedMs &&
mostRecentModifiedFileMs < actorModifiedMs &&
(actorConfig?.name || forceActorId)
Expand Down
Loading