Skip to content

Support YAML block object inputs #1

Description

@gregreindel

Object-shaped inputs like data, parser-options, llm-options, and executor-options currently need to be provided as JSON strings:

with:
  data: |
    {
      "input": "hello",
      "count": 3
    }

This works, but it feels awkward inside GitHub Actions YAML and makes simple examples look more technical than they need to be.

Proposal: accept YAML-formatted object strings for the same inputs, while keeping JSON support unchanged.

with:
  data: |
    input: hello
    count: 3

This would still be parsed from a string, because GitHub Actions with: inputs are scalar strings. It would not support true nested with: maps like:

with:
  data:
    input: hello

Suggested behavior:

  • Empty input still defaults to {}.
  • Valid JSON object strings continue to work.
  • Valid YAML object strings also work.
  • Arrays/scalars are rejected with a clear error.
  • Applies consistently to data, parser-options, llm-options, and executor-options.

Why:

  • Makes the action feel more native to GitHub Actions.
  • Improves copy/paste ergonomics for non-expert users.
  • Supports the fast setup value prop without breaking existing workflows.
  • Runtime impact should be negligible because the YAML parser is bundled into the action and input parsing is tiny compared with the LLM call.

Implementation sketch:

  • Add an explicit YAML parser dependency, likely js-yaml.
  • Replace readJsonObject with readObjectInput.
  • Try JSON.parse first, then YAML parse.
  • Keep the existing plain-object validation.
  • Add tests for JSON, YAML object strings, empty defaults, and rejected arrays/scalars.
  • Update README examples to prefer YAML blocks while noting JSON is also supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions