feat: ask before apify push drops a Git source - #1378
Merged
Conversation
`apify push` on a Git-sourced version switched the source type to the local files without a word, so the Git connection was gone before anyone noticed. Now it warns with the repository URL, points at `git push`, and asks. `--force` skips the question. Without a terminal and without it, the push stops. Closes #1142. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
| }) => { | ||
| warning({ | ||
| message: [ | ||
| `Actor ${actorName} builds from a Git repository: ${gitRepoUrl}`, |
l2ysho
marked this pull request as ready for review
September 2, 2026 08:14
DaveHanns
approved these changes
Sep 2, 2026
szaganek
reviewed
Sep 2, 2026
szaganek
reviewed
Sep 2, 2026
Co-authored-by: Edyta <142720610+szaganek@users.noreply.github.com>
Co-authored-by: Edyta <142720610+szaganek@users.noreply.github.com>
Co-authored-by: Edyta <142720610+szaganek@users.noreply.github.com>
l2ysho
enabled auto-merge (squash)
September 2, 2026 09:43
The copy edits on the branch changed both the Git-source hint and the "newer on the platform" error. Point the assertions at the new wording. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
TL;DR —
apify pushon a Git-sourced Actor version now says what it is about to drop and asks before it switches the source to the local files.--forceanswers yes. Without a terminal and without--force, the push stops.Closes #1142.
What happened before
apify pushset the version'ssourceTypetoSOURCE_FILESwithout a word. The Git connection and its build setup were gone before anyone noticed, and the platform kept building from the uploaded files. See the issue comments for the agreed shape of the prompt.What changed
The version is fetched before the upload, not after. When its source type is
GIT_REPO, the command prints a warning with the repository URL, points atgit pushas the way to build from the repository, and asks:The question comes after the "modified on the platform" check, so nobody confirms a push that is about to be refused anyway.
No stops the push before anything is uploaded. The Actor is untouched.
--forceskips the question but keeps the warning. Its description now covers both cases it overrides: a newer remote version, and a Git source.Non-interactive runs without
--forcestop with an error that names the flag. This is a behavior change for CI pipelines that push to a Git-sourced Actor. Such a pipeline is replacing the repository source on every run, so it should say so explicitly.Source-files and tarball versions are not affected. No prompt, no new output.
The second half of the issue
"After switching back to Git, Automatic builds could not be enabled." The API only
$sets the keys it receives, soapify pushleavesgitRepoUrlandgithubWebhookIdon the version and flipssourceTypeonly. Whether Console then re-creates the version fields on switch-back is a platform question. Not touched here, and the prompt above removes the usual way into it.Relation to #1377
#1377 turns Automatic builds on for Actors that
apify create --source <provider>makes. This PR is independent of it and applies onmaster. The warning text says "when Automatic builds are on" rather than promising a build, since a Console-created Actor may have them off.Verification
lint,format,build,test:localclean.docs/reference.mdregenerated for the--forcedescription.7 new tests in
test/local/commands/push-git-source.test.ts, with the platform client mocked: the non-interactive stop leaves the version untouched and names--force; no leaves it untouched; yes and--forceswitch the source toSOURCE_FILES, and--forcenever reaches the prompt; source-files and tarball versions neither ask nor warn.Not run live against a real Git-sourced Actor yet. Draft until that is done.
🤖 Generated with Claude Code