Skip to content

Let a workflow_dispatch choice input take its options from an enum - #696

Draft
ChrisonSimtian wants to merge 2 commits into
Fallout-build:developfrom
ChrisonSimtian:hotfix/v10.4.1-input-options-from
Draft

ChrisonSimtian wants to merge 2 commits into
Fallout-build:developfrom
ChrisonSimtian:hotfix/v10.4.1-input-options-from

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

Problem

A Choice input must list its options as string constants. Builds that already have an enum for the same values type the list twice, and the two copies drift.

Outcome

  • New OptionsFrom property on GitHubActionsInputAttribute. It takes an enum type.
  • The options are the enum names in declaration order.
  • OptionsFrom requires Type = Choice.
  • Generation fails if OptionsFrom is not an enum, if Options is also set, if Type is not Choice, or if Default is not an enum name.
  • Options are resolved in one helper, used by both validation and output.
  • Without OptionsFrom the output is unchanged.

Tests

  • Specs in GitHubActionsInputValidationSpecs for a non-enum type, both set, a non-choice type, and a default outside or inside the enum.
  • A spec in GitHubActionsDispatchInputSpecs that enum options and explicit options give identical YAML.

Targets main as a 10.4.x patch, same as the other 10.4.1 hotfix branches.

Add OptionsFrom to GitHubActionsInputAttribute so the option list is declared
once. Options are resolved in a single helper shared by validation and output.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ChrisonSimtian ChrisonSimtian added enhancement New feature or request target/vCurrent Targets the current version labels Oct 5, 2026
Enum.GetNames sorts by value, so an enum with out-of-order values gave a
different dropdown order. Read the fields in declaration order instead and
cover it with a non-ascending enum in the spec.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ChrisonSimtian
ChrisonSimtian changed the base branch from main to develop October 5, 2026 00:56

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request target/vCurrent Targets the current version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant