Skip to content

Repair unparseable publish workflow - #9

Merged
TorinKS merged 1 commit into
mainfrom
fix/workflow-yaml-heredoc
Aug 30, 2026
Merged

Repair unparseable publish workflow#9
TorinKS merged 1 commit into
mainfrom
fix/workflow-yaml-heredoc

Conversation

@TorinKS

@TorinKS TorinKS commented Aug 30, 2026

Copy link
Copy Markdown
Owner

What happened

publish-nuget.yaml has been invalid YAML since #6 merged. I introduced a PowerShell here-string in the exact-tag guard:

        run: |
          $tag = git describe --exact-match --tags HEAD 2>$null
          ...
            throw @"
HEAD is not at a tag, so the derived version would be wrong.

A here-string requires its body and closing "@ to begin at column 0. That un-indents straight out of the enclosing run: | block scalar:

YAMLException: can not read a block mapping entry;
a multiline key may not be an implicit key (121:13)

Why it went unnoticed

GitHub could not parse the file, so it could not apply the on: filters either. Every push produced a startup failure with zero jobs — including pushes to feature branches that tags: ['v*'] should have excluded. Six such runs accumulated.

None of them appeared in pull request checks, because this workflow is not a PR check. The PRs stayed green while the publisher was dead.

The consequence

v0.1.2 was tagged and its GitHub release published successfully — that is a different workflow. But nothing reached nuget.org:

https://api.nuget.org/v3-flatcontainer/windevicesnet/index.json
{"versions":["0.1.1"]}

Neither the tag push nor the new workflow_run trigger ever ran. The workflow_run mechanism from #8 is therefore still unproven; it has not had a chance to fire.

The fix

Build the message by concatenation so every line stays inside the block scalar. No behaviour change to the guard itself.

Verified with a YAML parser rather than by reading it:

File Result
current main YAMLException … (121:13)
this branch parses; push, workflow_run and workflow_dispatch all intact

After merge

v0.1.2 already exists, so its tag-push event is spent. The publish will need one manual dispatch to catch up; the exact-tag guard will pass, since main sits on v0.1.2. The automatic path gets its first real test at v0.1.3.

Worth a follow-up: a workflow-lint check that runs as a PR check, so an unparseable workflow fails visibly instead of silently.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XnzCrAM46SttZnU6msznyN

publish-nuget.yaml has been invalid YAML since #6 merged. A PowerShell
here-string needs its body and closing "@ to start at column 0, and that
un-indents straight out of the enclosing `run: |` block scalar:

    YAMLException: can not read a block mapping entry;
    a multiline key may not be an implicit key (121:13)

GitHub could not parse the file, so it could not apply the `on:` filters
either. Every push produced a startup failure with zero jobs, including
pushes to feature branches that the tag filter should have excluded. Those
failures were invisible from the pull request checks, because this workflow
is not one of them.

The consequence: v0.1.2 was tagged and released on GitHub, but nothing
published. nuget.org still lists 0.1.1 only, and neither the tag push nor
the new workflow_run trigger ever ran.

Build the message by concatenation instead, so every line stays inside the
block scalar. Verified with a YAML parser this time rather than by reading:
the previous file raises the exception above, the new one parses and keeps
all three triggers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XnzCrAM46SttZnU6msznyN
@TorinKS
TorinKS merged commit d367b78 into main Aug 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant