Skip to content

Commit 107c96d

Browse files
dblockCopilot
andcommitted
Fix update_api workflow failing on non-JSON AI changelog response
The 'Build changelog entries' step ran under bash -e. When the AI response wasn't valid JSON, jq exited with status 5, which killed the whole step instead of falling back to the default changelog entry. Also always logs the raw AI response for easier debugging. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e0f841a commit 107c96d

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎.github/workflows/update_api.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ jobs:
6868
run: |
6969
entries=""
7070
if [ "${{ steps.changes.outputs.changed }}" = "true" ]; then
71-
entries="$(grep -v '^```' "${{ steps.ai.outputs.response-file }}" 2>/dev/null | jq -r '.entries[]? // empty' 2>/dev/null)"
71+
response_file="${{ steps.ai.outputs.response-file }}"
72+
echo "AI changelog response:"
73+
cat "$response_file" || true
74+
filtered="$(grep -v '^```' "$response_file" 2>/dev/null)"
75+
entries="$(printf '%s' "$filtered" | jq -r '.entries[]? // empty' 2>/dev/null || true)"
7276
fi
7377
if [ -z "$entries" ]; then
7478
entries="Update API from slack-api-ref@${{ steps.api-ref.outputs.api-ref }}"

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* [#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).
44
* [#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).
55
* [#593](https://github.com/slack-ruby/slack-ruby-client/pull/593): Migrate AI CHANGELOG entry generation to Copilot CLI after GitHub Models retirement - [@dblock](https://github.com/dblock).
6+
* [#596](https://github.com/slack-ruby/slack-ruby-client/pull/596): Fix the `update_api` workflow failing with exit code 5 when the AI-generated changelog response isn't valid JSON, and always log the raw AI response for debugging - [@dblock](https://github.com/dblock).
67
* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Add entity.acknowledgeCommentAction and entity.presentComments methods - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
78
* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Add admin.apps.mcpServers, admin.apps.mcpServers.permissions, and admin.apps.permissions endpoints - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).
89
* [#590](https://github.com/slack-ruby/slack-ruby-client/pull/590): Add a metadata argument to chat.postEphemeral - [@slack-ruby-ci-bot](https://github.com/apps/slack-ruby-ci-bot).

0 commit comments

Comments
 (0)