Skip to content

Commit 952a38f

Browse files
authored
Merge pull request #593 from dblock/migrate-copilot-cli-provider
Migrate AI CHANGELOG entry generation to Copilot CLI
2 parents 2d66c31 + f680f6b commit 952a38f

3 files changed

Lines changed: 14 additions & 25 deletions

File tree

‎.github/prompts/changelog-entries.prompt.yml‎

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ messages:
66
are code-generated from JSON method definitions vendored from
77
https://github.com/slack-ruby/slack-api-ref (via a git submodule and rake task).
88
9-
Given a diffstat and a diff of the regenerated files, respond with a JSON object:
9+
Given a diffstat and a diff of the regenerated files, respond with ONLY a single JSON
10+
object (no markdown code fences, no other text) in exactly this shape:
1011
{"entries": [string, ...]}
1112
1213
Rules for entries:
@@ -29,24 +30,3 @@ messages:
2930
3031
Diff (may be truncated):
3132
{{diff}}
32-
model: openai/gpt-4o-mini
33-
responseFormat: json_schema
34-
jsonSchema: |-
35-
{
36-
"name": "changelog_entries",
37-
"strict": true,
38-
"schema": {
39-
"type": "object",
40-
"properties": {
41-
"entries": {
42-
"type": "array",
43-
"items": {
44-
"type": "string"
45-
},
46-
"description": "1-8 short, imperative-mood CHANGELOG entry descriptions, no leading bullet or trailing period"
47-
}
48-
},
49-
"additionalProperties": false,
50-
"required": ["entries"]
51-
}
52-
}

‎.github/workflows/update_api.yml‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
permissions:
1111
contents: write
1212
pull-requests: write
13-
models: read
1413
steps:
1514
- uses: actions/checkout@v7
1615
with:
@@ -46,21 +45,30 @@ jobs:
4645
run: |
4746
git diff --stat | sed 's/^/ /' > /tmp/diff_stat.txt
4847
git diff | head -c 20000 | sed 's/^/ /' > /tmp/diff.txt
48+
- name: Set up Node
49+
if: steps.changes.outputs.changed == 'true'
50+
uses: actions/setup-node@v6
51+
- name: Install Copilot CLI
52+
if: steps.changes.outputs.changed == 'true'
53+
run: npm install -g @github/copilot
4954
- name: Generate changelog entries with AI
5055
if: steps.changes.outputs.changed == 'true'
5156
id: ai
52-
uses: actions/ai-inference@v1
57+
uses: actions/ai-inference@v3
5358
with:
5459
prompt-file: ./.github/prompts/changelog-entries.prompt.yml
60+
model: ''
5561
file_input: |
5662
diff_stat: /tmp/diff_stat.txt
5763
diff: /tmp/diff.txt
64+
env:
65+
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_PAT }}
5866
- name: Build changelog entries
5967
id: entries
6068
run: |
6169
entries=""
6270
if [ "${{ steps.changes.outputs.changed }}" = "true" ]; then
63-
entries="$(jq -r '.entries[]? // empty' "${{ steps.ai.outputs.response-file }}" 2>/dev/null)"
71+
entries="$(grep -v '^```' "${{ steps.ai.outputs.response-file }}" 2>/dev/null | jq -r '.entries[]? // empty' 2>/dev/null)"
6472
fi
6573
if [ -z "$entries" ]; then
6674
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
@@ -2,6 +2,7 @@
22

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).
5+
* [#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).
56
* Your contribution here.
67

78
### 3.2.0 (2026/07/05)

0 commit comments

Comments
 (0)