Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions .github/prompts/changelog-entries.prompt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ messages:
are code-generated from JSON method definitions vendored from
https://github.com/slack-ruby/slack-api-ref (via a git submodule and rake task).

Given a diffstat and a diff of the regenerated files, respond with a JSON object:
Given a diffstat and a diff of the regenerated files, respond with ONLY a single JSON
object (no markdown code fences, no other text) in exactly this shape:
{"entries": [string, ...]}

Rules for entries:
Expand All @@ -29,24 +30,3 @@ messages:

Diff (may be truncated):
{{diff}}
model: openai/gpt-4o-mini
responseFormat: json_schema
jsonSchema: |-
{
"name": "changelog_entries",
"strict": true,
"schema": {
"type": "object",
"properties": {
"entries": {
"type": "array",
"items": {
"type": "string"
},
"description": "1-8 short, imperative-mood CHANGELOG entry descriptions, no leading bullet or trailing period"
}
},
"additionalProperties": false,
"required": ["entries"]
}
}
14 changes: 11 additions & 3 deletions .github/workflows/update_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
permissions:
contents: write
pull-requests: write
models: read
steps:
- uses: actions/checkout@v7
with:
Expand Down Expand Up @@ -46,21 +45,30 @@ jobs:
run: |
git diff --stat | sed 's/^/ /' > /tmp/diff_stat.txt
git diff | head -c 20000 | sed 's/^/ /' > /tmp/diff.txt
- name: Set up Node
if: steps.changes.outputs.changed == 'true'
uses: actions/setup-node@v6
- name: Install Copilot CLI
if: steps.changes.outputs.changed == 'true'
run: npm install -g @github/copilot
- name: Generate changelog entries with AI
if: steps.changes.outputs.changed == 'true'
id: ai
uses: actions/ai-inference@v1
uses: actions/ai-inference@v3
with:
prompt-file: ./.github/prompts/changelog-entries.prompt.yml
model: ''
file_input: |
diff_stat: /tmp/diff_stat.txt
diff: /tmp/diff.txt
env:
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_PAT }}
- name: Build changelog entries
id: entries
run: |
entries=""
if [ "${{ steps.changes.outputs.changed }}" = "true" ]; then
entries="$(jq -r '.entries[]? // empty' "${{ steps.ai.outputs.response-file }}" 2>/dev/null)"
entries="$(grep -v '^```' "${{ steps.ai.outputs.response-file }}" 2>/dev/null | jq -r '.entries[]? // empty' 2>/dev/null)"
fi
if [ -z "$entries" ]; then
entries="Update API from slack-api-ref@${{ steps.api-ref.outputs.api-ref }}"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,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).
* Your contribution here.

### 3.2.0 (2026/07/05)
Expand Down
Loading