Skip to content

fix(types): type WorkflowDispatchInput.default as string | number | boolean - #123

Merged
emmanuelnk merged 2 commits into
mainfrom
fix/workflow-dispatch-input-default
Aug 11, 2026
Merged

fix(types): type WorkflowDispatchInput.default as string | number | boolean#123
emmanuelnk merged 2 commits into
mainfrom
fix/workflow-dispatch-input-default

Conversation

@emmanuelnk

Copy link
Copy Markdown
Owner

Problem

WorkflowDispatchInput.default compiles to { [k: string]: unknown } (#119). The upstream schema declares no type on default — it constrains it per input type via if/then conditionals (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: pin default to type: ['string', 'number', 'boolean'] — the union of values the conditionals allow, and exactly how the schema already declares default on workflow_call inputs. Not just string (as suggested in the issue) because boolean- and number-typed inputs take matching defaults.

Based on the #118 branch since it builds on the regenerated types there; retargets to main automatically 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

@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
github-actions-workflow-ts Ready Ready Preview Aug 11, 2026 8:40pm

@github-actions github-actions Bot added the bug Something isn't working label Aug 11, 2026
Base automatically changed from chore/schema-update-260617 to main August 11, 2026 16:54
…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
emmanuelnk merged commit 342b13c into main Aug 11, 2026
9 checks passed
@emmanuelnk
emmanuelnk deleted the fix/workflow-dispatch-input-default branch August 11, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WorkflowDispatchInput.default seems broken

1 participant