fix(types): type WorkflowDispatchInput.default as string | number | boolean - #123
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…oolean
The schema constrains default per input type via if/then conditionals,
which json-schema-to-typescript cannot express and compiled to
{ [k: string]: unknown }. Pin the union the conditionals allow, mirroring
how workflow_call inputs declare their default.
Fixes #119
emmanuelnk
force-pushed
the
fix/workflow-dispatch-input-default
branch
from
August 11, 2026 16:56
d641f25 to
a50d72e
Compare
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.
Problem
WorkflowDispatchInput.defaultcompiles to{ [k: string]: unknown }(#119). The upstream schema declares notypeondefault— it constrains it per inputtypeviaif/thenconditionals (string/boolean/number), which json-schema-to-typescript cannot express, so it falls back to an unknown-object.Solution
Pre-process the fetched schema in
generateWorkflowTypes.ts: pindefaulttotype: ['string', 'number', 'boolean']— the union of values the conditionals allow, and exactly how the schema already declaresdefaultonworkflow_callinputs. Not juststring(as suggested in the issue) becauseboolean- andnumber-typed inputs take matching defaults.Based on the #118 branch since it builds on the regenerated types there; retargets to
mainautomatically once #118 merges.Test Plan
All 302 tests pass across lib/cli/actions. Generated output now reads
default?: string | number | boolean.Fixes #119
🤖 Generated with Claude Code