diff --git a/.github/prompts/changelog-entries.prompt.yml b/.github/prompts/changelog-entries.prompt.yml index f8f47519..83d10717 100644 --- a/.github/prompts/changelog-entries.prompt.yml +++ b/.github/prompts/changelog-entries.prompt.yml @@ -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: @@ -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"] - } - } diff --git a/.github/workflows/update_api.yml b/.github/workflows/update_api.yml index 8a77ecca..3e0d0a41 100644 --- a/.github/workflows/update_api.yml +++ b/.github/workflows/update_api.yml @@ -10,7 +10,6 @@ jobs: permissions: contents: write pull-requests: write - models: read steps: - uses: actions/checkout@v7 with: @@ -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 }}" diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a2bb780..749b4cfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)