From 107c96d0a50db4d93f94fcb4d0ebd36774fd7ddb Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Mon, 24 Aug 2026 22:24:46 -0400 Subject: [PATCH] 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> --- .github/workflows/update_api.yml | 6 +++++- CHANGELOG.md | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update_api.yml b/.github/workflows/update_api.yml index 095e6c94..c2edd5b2 100644 --- a/.github/workflows/update_api.yml +++ b/.github/workflows/update_api.yml @@ -68,7 +68,11 @@ jobs: run: | entries="" if [ "${{ steps.changes.outputs.changed }}" = "true" ]; then - entries="$(grep -v '^```' "${{ steps.ai.outputs.response-file }}" 2>/dev/null | jq -r '.entries[]? // empty' 2>/dev/null)" + response_file="${{ steps.ai.outputs.response-file }}" + echo "AI changelog response:" + cat "$response_file" || true + filtered="$(grep -v '^```' "$response_file" 2>/dev/null)" + entries="$(printf '%s' "$filtered" | jq -r '.entries[]? // empty' 2>/dev/null || true)" fi if [ -z "$entries" ]; then entries="Update API from slack-api-ref@${{ steps.api-ref.outputs.api-ref }}" diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e306ff0..ec90e2b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * [#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). * [#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). +* [#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). * [#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). * [#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). * [#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).