# Generating AI Descriptions of Automated Pull Requests

DevFeed: [Generating AI Descriptions of Automated Pull Requests](<https://devfeed.tech/articles/generating-ai-descriptions-of-automated-pull-requests-20531.md>)

Original publisher: [Read original article](<https://code.dblock.org/2026/08/11/generating-ai-descriptions-of-automated-pull-requests.html>)

Author: Daniel Doubrovkine (dblock@dblock.org)

Published: 2026-08-11T00:00:00Z

Content type: tutorial

Language: en

Sources: [Daniel Doubrovkine](<https://devfeed.tech/sources/daniel-doubrovkine.md>)

Topics: [GitHub Copilot CLI](<https://devfeed.tech/topics/github-copilot-cli.md>), [GitHub Actions](<https://devfeed.tech/topics/github-actions.md>), [GitHub Copilot](<https://devfeed.tech/topics/github-copilot.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>), [Slack](<https://devfeed.tech/topics/slack.md>), [changelog](<https://devfeed.tech/topics/changelog.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [JSON](<https://devfeed.tech/topics/json.md>), [YAML](<https://devfeed.tech/topics/yaml.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [automated](<https://devfeed.tech/tags/automated.md>), [changelog](<https://devfeed.tech/tags/changelog.md>), [ci](<https://devfeed.tech/tags/ci.md>), [cli](<https://devfeed.tech/tags/cli.md>), [copilot](<https://devfeed.tech/tags/copilot.md>), [github](<https://devfeed.tech/tags/github.md>), [github-actions](<https://devfeed.tech/tags/github-actions.md>), [github-copilot](<https://devfeed.tech/tags/github-copilot.md>), [github-copilot-cli](<https://devfeed.tech/tags/github-copilot-cli.md>), [json](<https://devfeed.tech/tags/json.md>), [llm](<https://devfeed.tech/tags/llm.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [pull-request](<https://devfeed.tech/tags/pull-request.md>), [pull-requests](<https://devfeed.tech/tags/pull-requests.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [yaml](<https://devfeed.tech/tags/yaml.md>)

## AI overview

A tutorial explains how the maintainer of the slack-ruby-client library uses a scheduled GitHub Actions workflow and GitHub Copilot CLI to generate meaningful commit messages, pull request bodies, and CHANGELOG entries from diffs of regenerated Slack API code. It also covers YAML indentation, prompt files, response logging, and extracting a JSON result from Copilot CLI output.

## Source excerpt

The slack-ruby-client library, an open source Ruby gem I maintain, runs a scheduled GitHub Actions workflow that regenerates code from Slack's API definitions and opens a pull request with the diff. The commit message and CHANGELOG entry used to be a generic "Update API (2026-08-11)", which told a reviewer nothing about what actually changed. Here's how we taught the workflow to describe its own diffs, using GitHub Copilot CLI, which open source maintainers can get for free. The Idea The workflow already computes a diff before opening the pull request. Instead of a boilerplate commit message, we pipe that diff through an LLM and ask it to summarize what changed, then use the response as the commit message and PR body. - 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 | sed 's/^/ /' > /tmp/diff_stat.txt git diff | head -c 20000 | sed 's/^/ /' > /tmp/diff.txt The sed 's/^/ /' indent isn't decorative. actions/ai-inference substitutes template variables as raw text into a prompt YAML file before parsing it, so a multi-line diff starting at column 0 breaks the indentation of the enclosing content: |- block scalar. Pre-indenting the file to match keeps the YAML valid no matter what the diff looks like. The Prompt File actions/ai-inference supports .prompt.yml files, a small convention for keeping the system/user prompt out of the workflow YAML. messages: - role: system content: |- You write CHANGELOG entries describing an automated API update to slack-ruby-client, a Ruby gem whose Web API endpoint methods, argument validations, specs, and bin commands are code-generated from vendored Slack API method definitions (via a git submodule and rake task). Given a diffstat and a diff of the regenerated files, respond with ONLY a single JSON object (no markdown code fence