Skip to content

fix: YAML syntax error in ci.yml caused by heredoc body at column 0#23895

Merged
pelikhan merged 1 commit intomainfrom
copilot/fix-syntax-issues-ci-yml
Apr 1, 2026
Merged

fix: YAML syntax error in ci.yml caused by heredoc body at column 0#23895
pelikhan merged 1 commit intomainfrom
copilot/fix-syntax-issues-ci-yml

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

A bash heredoc (<<'PYEOF') inside a run: | block had its body at column 0, which terminates YAML's literal block scalar early and causes a parse error.

Change

Replaced the heredoc with printf '%s\n' lines writing to a temp file, keeping all content properly indented within the YAML block scalar:

# Before — Python lines at col 0 break YAML parsing
RELATIVE_IMPORTS=$(python3 - "$WORKFLOW" <<'PYEOF'
import sys, re
content = open(sys.argv[1]).read()
...
PYEOF
)

# After — all lines indented, equivalent behaviour
printf '%s\n' \
  'import sys, re' \
  'content = open(sys.argv[1]).read()' \
  ...
  > /tmp/gh-aw-check-imports.py
RELATIVE_IMPORTS=$(python3 /tmp/gh-aw-check-imports.py "$WORKFLOW")

@pelikhan pelikhan marked this pull request as ready for review April 1, 2026 13:07
Copilot AI review requested due to automatic review settings April 1, 2026 13:07
@pelikhan pelikhan merged commit 0b6fa97 into main Apr 1, 2026
88 of 131 checks passed
@pelikhan pelikhan deleted the copilot/fix-syntax-issues-ci-yml branch April 1, 2026 13:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a YAML parsing error in the CI workflow caused by an unindented bash heredoc body inside a run: | block.

Changes:

  • Replaces the inline python3 - <<'PYEOF' heredoc with a printf '%s\n' ... > /tmp/... approach so all script content stays indented within the YAML literal block.
  • Executes the generated temporary Python script to collect relative import paths from the added workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +2659 to +2660
> /tmp/gh-aw-check-imports.py
RELATIVE_IMPORTS=$(python3 /tmp/gh-aw-check-imports.py "$WORKFLOW")
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script is written to a predictable path in /tmp. Using a fixed filename can be vulnerable to symlink/hardlink tricks and can also collide if this step is ever reused in a context where multiple instances run on the same machine. Prefer creating the file with mktemp (or under $RUNNER_TEMP) and cleaning it up with a trap before invoking python.

Copilot uses AI. Check for mistakes.
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.

3 participants