Skip to content

Bug: workflow name containing (script:) causes YAML parse failure on test-portable-script.yml #6

Description

@edwinjhlee

Symptom

test-portable-script.yml does not work as expected:

  1. gh workflow list shows it with the file path as its name, instead of the value of the name: field:

    .github/workflows/test-portable-script.yml  active  345808542
    

    Compare with other recent workflows that show their name: properly:

    Example — Docker Buildx      active  345806523
    Example — x-cmd Release Channels  active  345808541
    
  2. gh workflow run test-portable-script.yml --repo x-cmd/action fails:

    could not create workflow dispatch event: HTTP 422: Workflow does not have 'workflow_dispatch' trigger
    

Root cause

The name: field in .github/workflows/test-portable-script.yml line 17 is:

name: Example — Portable Script (script:)

The token (script:) contains a colon. When YAML parses this line, the : inside the parentheses is interpreted as a mapping separator, breaking the parse. The whole name: field then falls back to its default (the file path), and GitHub can't extract the on: workflow_dispatch: trigger reliably.

Verified locally:

$ python3 -c "import yaml; yaml.safe_load(open('.github/workflows/test-portable-script.yml'))"
yaml.scanner.ScannerError: mapping values are not allowed here
  in ".github/workflows/test-portable-script.yml", line 17, column 49

Suggested fix (do not apply yet)

Quote the name: value, or remove the (script:) decoration:

# Option A — quote it
name: "Example — Portable Script (script:)"

# Option B — drop the parens
name: Example — Portable Script via script input

Why this matters

This is a documentation / example gallery regression: the file was added in commit abeda03 to demonstrate the §1.4 Pattern C convention, but it can't be triggered via workflow_dispatch until the name is fixed.

Status

  • Root cause identified (YAML parse failure on unquoted name:)
  • Fix applied
  • Verified via gh workflow run

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions