verify-action-build: support Dart-based actions (setup-dart)#741
Merged
Conversation
Actions such as dart-lang/setup-dart compile their source from Dart to JavaScript in the `build` npm script (`dart compile js ...`) and then bundle via a bare `ncc build` invocation in `dist`. The node:slim base image has neither the Dart SDK nor `@vercel/ncc`, so the build loop silently fell through to the `npx ncc build --source-map` fallback, producing an incomplete rebuild missing `main.cjs` and `sig.txt`. When a `pubspec.yaml` is detected at the repo root, install the Dart SDK from Google's apt repo, install `@vercel/ncc` globally, and run `dart pub get` so the pubspec dependencies resolve before compilation. Also add `all` to the list of candidate npm scripts so actions whose `all` script chains build+package steps (the setup-dart convention) run as a single step. With these changes, `verify-action-build --from-pr 739` against dart-lang/setup-dart@e51d8e571e22 reports "All compiled JavaScript matches the rebuild". Generated-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7 tasks
dave2wave
approved these changes
Apr 19, 2026
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.
Summary
Teach
verify-action-buildto rebuild actions whose source is written in Dart (e.g.dart-lang/setup-dart).When a
pubspec.yamlexists at the repo root, the Dockerfile now:@vercel/nccglobally (setup-dart'sdistscript invokes barencc buildrather thannpx ncc, so it has to be onPATH).dart pub getso pubspec dependencies (path,pub_semver, …) are resolved beforedart compile js.Also adds
allto the list of candidate npm scripts — setup-dart'sallscript chainsbuild+distas one step, and other actions use the same convention.Why this was broken
Without these tools the Dockerfile's
npm run build/package/startloop failed silently (2>/dev/null) and fell through to thenpx ncc build --source-mapfallback. That produceddist/index.mjsbut omitteddist/main.cjs(the dart2js output) anddist/sig.txt(generated bydart tool/sig.dart), so every rebuild of a Dart action diffed against the published one.Verification
Against PR #739 (allowing
dart-lang/setup-dart@e51d8e571e22):Before:
After:
Test plan
uv run utils/verify-action-build.py --from-pr 739 --cipasses againstdart-lang/setup-dart@e51d8e571e22