Symptom
test-portable-script.yml does not work as expected:
-
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
-
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
Symptom
test-portable-script.ymldoes not work as expected:gh workflow listshows it with the file path as its name, instead of the value of thename:field:Compare with other recent workflows that show their
name:properly:gh workflow run test-portable-script.yml --repo x-cmd/actionfails:Root cause
The
name:field in.github/workflows/test-portable-script.ymlline 17 is: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 wholename:field then falls back to its default (the file path), and GitHub can't extract theon: workflow_dispatch:trigger reliably.Verified locally:
Suggested fix (do not apply yet)
Quote the
name:value, or remove the(script:)decoration:Why this matters
This is a documentation / example gallery regression: the file was added in commit
abeda03to demonstrate the §1.4 Pattern C convention, but it can't be triggered viaworkflow_dispatchuntil the name is fixed.Status
name:)gh workflow run