From 7e879ccbe31994b70956b6c3c062832baa5f0e23 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Tue, 11 Aug 2026 21:18:43 -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 commit-message.prompt.yml (which expects continuation lines to be indented), causing "Failed to parse prompt file: bad indentation of a mapping entry" at runtime. 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.yml | 4 ++-- CHANGELOG.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 1f54574c..67fbb528 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -39,8 +39,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 commit message with AI if: steps.changes.outputs.changed == 'true' id: ai diff --git a/CHANGELOG.md b/CHANGELOG.md index 73f36a42..940a0159 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Changelog Some notable infrastructure contributions below. See [commits](commits/master) for Slack API updates. * Your contribution here. +* [#88](https://github.com/slack-ruby/slack-api-ref/pull/88): Fix a YAML indentation bug in AI commit message generation - [@dblock](https://github.com/dblock). * [#87](https://github.com/slack-ruby/slack-api-ref/pull/87): Generate AI commit summaries for automated API updates - [@dblock](https://github.com/dblock). * [#64](https://github.com/slack-ruby/slack-api-ref/pull/64): Add `arg_groups` for groups of arguments whose requirement is interdependent - [@jmanian](https://github.com/jmanian). * [#64](https://github.com/slack-ruby/slack-api-ref/pull/64): Add `"format": "json"` attribute for arguments that need to be JSON strings - [@jmanian](https://github.com/jmanian).