From 43856fb009383010a38d449d1609ba1a9fcf4170 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Tue, 11 Aug 2026 20:30:50 -0400 Subject: [PATCH 1/3] Generate AI commit summaries for automated API updates The daily "update" workflow committed changes with a generic, date-only message ("Updated from Slack docs, YYYY/MM/DD"), which doesn't say anything about what actually changed. Add a GitHub Models-backed step (actions/ai-inference@v1, using the default GITHUB_TOKEN with models: read permission, no extra secrets/subscription needed) that summarizes git diff / git diff --stat of the scraped changes into a short commit title (<=72 chars) and a few bullet points, via a structured .github/prompts/commit-message.prompt.yml with a JSON schema response so the output is easy to parse reliably. Falls back to the original generic, date-based message if there are no changes, the AI call fails, or the response is malformed, so the workflow never blocks on this step. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/prompts/commit-message.prompt.yml | 43 ++++++++++++++++++++ .github/workflows/update.yml | 48 ++++++++++++++++++++++- 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 .github/prompts/commit-message.prompt.yml diff --git a/.github/prompts/commit-message.prompt.yml b/.github/prompts/commit-message.prompt.yml new file mode 100644 index 00000000..16d5c280 --- /dev/null +++ b/.github/prompts/commit-message.prompt.yml @@ -0,0 +1,43 @@ +messages: + - role: system + content: |- + You write concise git commit messages describing automated updates to a Slack Web + API reference JSON repository (methods, groups and events scraped from Slack's docs). + Given a diffstat and a diff, respond with: + - title: a single line, imperative mood, at most 72 characters, no trailing period, + describing the most significant change (e.g. "Add chat.appendStream and + chat.stopStream methods"). + - summary: 1-5 short bullet points (each starting with "- "), each describing one + notable change: new/removed/renamed methods or events, added/removed arguments, + changed error codes, etc. + If the diff is routine or has no notable API surface changes, keep the title generic + (e.g. "Minor documentation updates") and the summary brief or empty. + - role: user + content: |- + Diffstat: + {{diff_stat}} + + Diff (may be truncated): + {{diff}} +model: openai/gpt-4o-mini +responseFormat: json_schema +jsonSchema: |- + { + "name": "commit_message", + "strict": true, + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "Single-line, imperative-mood commit title, max 72 characters, no trailing period" + }, + "summary": { + "type": "string", + "description": "1-5 short bullet points, each starting with '- ', or empty string if nothing notable" + } + }, + "additionalProperties": false, + "required": ["title", "summary"] + } + } diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index fd089c58..1f54574c 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -5,6 +5,10 @@ on: schedule: - cron: "15 22 * * *" +permissions: + contents: write + models: read + jobs: update: runs-on: ubuntu-latest @@ -24,9 +28,51 @@ jobs: run: bundle exec rake api:validate - name: Get current date run: echo "CURRENT_DATE=$(date +%Y/%m/%d)" >> $GITHUB_ENV + - name: Check for changes + id: changes + run: | + if git diff --quiet; then + echo "changed=false" >> "$GITHUB_OUTPUT" + else + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + - 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 + - name: Generate commit message with AI + if: steps.changes.outputs.changed == 'true' + id: ai + uses: actions/ai-inference@v1 + with: + prompt-file: ./.github/prompts/commit-message.prompt.yml + file_input: | + diff_stat: /tmp/diff_stat.txt + diff: /tmp/diff.txt + - name: Build commit message + id: message + run: | + title="" + summary="" + if [ "${{ steps.changes.outputs.changed }}" = "true" ]; then + title="$(jq -r '.title // empty' "${{ steps.ai.outputs.response-file }}" 2>/dev/null)" + summary="$(jq -r '.summary // empty' "${{ steps.ai.outputs.response-file }}" 2>/dev/null)" + fi + if [ -z "$title" ]; then + title="Updated from Slack docs, ${CURRENT_DATE}" + summary="" + fi + { + echo 'message<> "$GITHUB_OUTPUT" - name: Commit changes uses: EndBug/add-and-commit@v9 with: author_name: Slack API Ref Buildbot author_email: buildbot@slack-api-ref.com - message: "Updated from Slack docs, ${{ env.CURRENT_DATE }}" + message: ${{ steps.message.outputs.message }} From 31c93bbb974cc3fd636891b3bd11d2d8160e0c53 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Tue, 11 Aug 2026 20:34:00 -0400 Subject: [PATCH 2/3] Update CHANGELOG.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d77bc0ee..73f36a42 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. +* [#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). * [#58](https://github.com/slack-ruby/slack-api-ref/pull/58): Set up Rubocop - [@kstole](https://github.com/kstole). From 6a27bb7cfeb6e7d0a907629c1203048ec5347c6f Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Tue, 11 Aug 2026 20:35:02 -0400 Subject: [PATCH 3/3] Update copyright year to 2026 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- LICENSE.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 811d3794..c3db0f96 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2015-2017 Daniel Doubrovkine, Artsy and Contributors +Copyright (c) 2015-2026 Daniel Doubrovkine, Artsy and Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.md b/README.md index 1ceb9181..3a4c3100 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,6 @@ This project is not affiliated with the [company that makes Slack](https://slack ### Copyright & License -Copyright (c) 2015-2017, Daniel Doubrovkine and [Contributors](CHANGELOG.md). +Copyright (c) 2015-2026, Daniel Doubrovkine and [Contributors](CHANGELOG.md). This project is licensed under the [MIT License](LICENSE.md).