Skip to content

feat: skip the build phase when build-command is none - #9

Merged
kristof-siket merged 1 commit into
mainfrom
feat/build-command-none
Aug 20, 2026
Merged

feat: skip the build phase when build-command is none#9
kristof-siket merged 1 commit into
mainfrom
feat/build-command-none

Conversation

@kristof-siket

Copy link
Copy Markdown
Collaborator

Why

The Prisma Console's setup generator supports repos with no build script — a stock bun create elysia app runs its TypeScript source directly. The action's build phase always runs build-command (default npm run build), so those repos fail on error: Script not found "build". Once this ships, the generator will emit build-command: none for such repos.

What

  • The exact input value none skips the build phase, in both deploy and destroy modes. The run logs build: skipped (build-command: none) and continues to install → deploy as before.
  • Only the literal none skips. An empty value still falls back to the default npm run build, and any other value runs verbatim — a blank or mistyped command can never silently skip a build.
  • The decision lives in a new build.mjs (selectBuildCommand), following the repo's pattern of small tested modules (composer.mjs, deployment.mjs); main.mjs executes on import, so the logic had to move to be unit-testable.
  • action.yml and the README document the value (inputs table row plus one sentence in the phases paragraph).

Build-report phases stay consistent

A skipped build sends no report update of its own, and the report never gets stuck in the build phase: mapPhase sends the install phase as the server-side build phase, so the report is already in build before the build command would run — the build phase's own update in a normal run re-sends that same value. The deploy phase then advances the report to deploy exactly as before. The server-visible phase sequence (builddeploy → terminal state) is identical with and without the skip.

Tests

  • node --test tests/*.test.mjs: 43 pass, 0 fail (5 new in tests/build.test.mjs: none skips, empty falls back to the default, other commands run verbatim, None and commands containing "none" do not skip).
  • CI's syntax checks (node --check on main.mjs, post.mjs, credentials.mjs, plus the new build.mjs) and the action.yml sanity check pass.
  • Offline end-to-end smoke of main.mjs with a stub bun and a dummy service token: deploy+none and destroy+none log the skip line and continue to the Composer step; a real build-command still runs in its ::group::build block; outcome succeeded in all three runs.

🤖 Generated with Claude Code

Repos with no build script run their source directly; the always-on build
phase failed them with 'Script not found "build"'. The exact input value
"none" now skips the build in both deploy and destroy modes. An empty
value still falls back to the default, so a blank or mistyped command can
never silently skip a build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kristof-siket
kristof-siket merged commit 3dfd635 into main Aug 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant