From 3d466cfd4badef46d998286a63d7bc9b90de39aa Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Tue, 11 Aug 2026 21:17:45 -0400 Subject: [PATCH] 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> --- .github/workflows/update_api.yml | 4 ++-- CHANGELOG.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update_api.yml b/.github/workflows/update_api.yml index 3eeefc0a..8a77ecca 100644 --- a/.github/workflows/update_api.yml +++ b/.github/workflows/update_api.yml @@ -44,8 +44,8 @@ jobs: - name: Prepare diff for AI summary if: steps.changes.outputs.changed == 'true' run: | - git diff --stat > /tmp/diff_stat.txt - git diff | head -c 20000 > /tmp/diff.txt + git diff --stat | sed 's/^/ /' > /tmp/diff_stat.txt + git diff | head -c 20000 | sed 's/^/ /' > /tmp/diff.txt - name: Generate changelog entries with AI if: steps.changes.outputs.changed == 'true' id: ai diff --git a/CHANGELOG.md b/CHANGELOG.md index 83b7f8f3..8a2bb780 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ### 3.2.1 (Next) * [#591](https://github.com/slack-ruby/slack-ruby-client/pull/591): Generate AI CHANGELOG entries and PR summaries for automated API update PRs, lock simplecov below 1.1.0 to avoid breaking Coveralls - [@dblock](https://github.com/dblock). +* [#592](https://github.com/slack-ruby/slack-ruby-client/pull/592): Fix a YAML indentation bug in AI CHANGELOG entry generation that broke the automated API update workflow - [@dblock](https://github.com/dblock). * Your contribution here. ### 3.2.0 (2026/07/05)