Skip to content

ci: fix YAML syntax error in release-on-main workflow#169

Merged
benvinegar merged 2 commits intomainfrom
fix/release-workflow-yaml-syntax
Feb 24, 2026
Merged

ci: fix YAML syntax error in release-on-main workflow#169
benvinegar merged 2 commits intomainfrom
fix/release-workflow-yaml-syntax

Conversation

@benvinegar
Copy link
Member

Problem

The heredoc body for the Claude prompt in release-on-main.yml was flush-left (unindented), which broke out of the YAML run: | block scalar. The YAML parser saw Allowed outputs: on line 105 as a mapping key, causing a parse error at line 104.

Fix

Replaced $(cat <<'EOF' ... EOF) with read -r -d '' PROMPT <<'PROMPT_EOF' || true and indented all heredoc content to match surrounding script indentation.

  • The || true is needed because read returns non-zero when hitting EOF with -d '', which would otherwise trip set -e.
  • All 3 workflow files pass YAML lint after this change.

Validation

npx yaml-lint .github/workflows/release-on-main.yml
✔ YAML Lint successful.

The heredoc body for the Claude prompt was flush-left, breaking out of
the YAML block scalar. The YAML parser saw 'Allowed outputs:' as a
mapping key, causing a parse error at line 104.

Fix: replace cat heredoc with read -r -d '' and indent the body to
match surrounding script indentation.
@greptile-apps
Copy link

greptile-apps bot commented Feb 24, 2026

Greptile Summary

Fixes a YAML syntax error in the release-on-main.yml workflow introduced in #162. The original $(cat <<'EOF' ... EOF) heredoc pattern placed unindented content inside a YAML run: | block scalar, causing the YAML parser to misinterpret Allowed outputs: as a mapping key.

  • Replaced with read -r -d '' PROMPT <<'PROMPT_EOF' || true pattern, which keeps all heredoc content properly indented within the YAML block scalar
  • The || true correctly handles read returning non-zero at EOF with -d '', preventing set -e from aborting the script
  • Verified: the old version fails YAML parsing; the new version parses correctly and produces the intended shell script

Confidence Score: 5/5

  • This PR is safe to merge — it fixes a confirmed YAML parse error with a well-understood shell pattern.
  • Single-file CI fix that corrects a verified YAML parsing failure. The replacement pattern (read -r -d '' with || true) is idiomatic and the YAML block scalar indentation was verified to produce the correct shell script after parsing. No functional changes to the workflow logic.
  • No files require special attention

Important Files Changed

Filename Overview
.github/workflows/release-on-main.yml Fixes YAML parse error by replacing $(cat <<'EOF' ... EOF) heredoc (which broke out of the YAML block scalar) with `read -r -d '' PROMPT <<'PROMPT_EOF'

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[YAML run: block scalar] --> B[Shell script extracted]
    B --> C["read -r -d '' PROMPT <<'PROMPT_EOF' || true"]
    C --> D[Heredoc content captured in PROMPT variable]
    D --> E[jq builds Anthropic API payload with $PROMPT]
    E --> F[curl sends request to Claude API]
    F --> G[Parse response JSON for release decision]

    style C fill:#90EE90,stroke:#333
    style A fill:#87CEEB,stroke:#333
Loading

Last reviewed commit: 8ff62c9

The indented heredoc preserves leading whitespace in the PROMPT variable.
Add a sed pass to strip the 10-space YAML indent so the prompt text sent
to the Claude API is clean.
@benvinegar benvinegar merged commit e472a1b into main Feb 24, 2026
9 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