Skip to content

Commit 18a4e05

Browse files
dblockCopilot
andcommitted
Fix YAML indentation bug in AI prompt template substitution
actions/ai-inference@v1 substitutes {{var}} placeholders as raw text into the prompt YAML file before parsing it as YAML. Since the diff/ diff-stat files started at column 0, injecting their multi-line content broke the indentation of the enclosing `content: |-` block scalar in changelog-entries.prompt.yml (which expects continuation lines to be indented), causing "Failed to parse prompt file: bad indentation of a mapping entry" at runtime, e.g.: https://github.com/slack-ruby/slack-ruby-client/actions/runs/31552877245/job/93979138338 Indent every line of the diff/diff-stat files with 6 spaces (to match the prompt file's block scalar indentation) before writing them out, so the substituted content stays inside the block. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5fce593 commit 18a4e05

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎.github/workflows/update_api.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ jobs:
4444
- name: Prepare diff for AI summary
4545
if: steps.changes.outputs.changed == 'true'
4646
run: |
47-
git diff --stat > /tmp/diff_stat.txt
48-
git diff | head -c 20000 > /tmp/diff.txt
47+
git diff --stat | sed 's/^/ /' > /tmp/diff_stat.txt
48+
git diff | head -c 20000 | sed 's/^/ /' > /tmp/diff.txt
4949
- name: Generate changelog entries with AI
5050
if: steps.changes.outputs.changed == 'true'
5151
id: ai

0 commit comments

Comments
 (0)