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
43 changes: 43 additions & 0 deletions .github/prompts/commit-message.prompt.yml
Original file line number Diff line number Diff line change
@@ -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"]
}
}
48 changes: 47 additions & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
schedule:
- cron: "15 22 * * *"

permissions:
contents: write
models: read

jobs:
update:
runs-on: ubuntu-latest
Expand All @@ -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<<COMMIT_MESSAGE_EOF'
echo "$title"
echo ""
echo "$summary"
echo 'COMMIT_MESSAGE_EOF'
} >> "$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 }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Loading