name: Release Notes
on:
workflow_dispatch:
inputs:
tag:
description: "Release tag (e.g. v0.3.0)"
required: true
type: string
concurrency:
group: release-notes-${{ github.event.inputs.tag }}
cancel-in-progress: true
jobs:
enhance:
name: Enhance release notes with Claude
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 with:
fetch-depth: 0
- name: Write release notes with Claude
uses: anthropics/claude-code-action@558b1d6cab4085c7753fe402c10bef0fbb92ac7a with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
claude_args: --allowedTools "Bash(git log:*),Bash(git describe:*),Read,Write"
prompt: |
Write an exciting, polished GitHub release body for if-changed ${{ inputs.tag }} and save it to `release-notes.md`.
if-changed is a Rust CLI tool for incremental builds — it conditionally runs commands only when specified files have changed. It's designed for use in build scripts, CI pipelines, and Makefiles to skip redundant work.
Steps:
1. Run `git describe --tags --abbrev=0 HEAD^` to get the previous tag, then run `git log <previous-tag>..HEAD --oneline` to see all commits in this release.
2. Read `README.md` and `src/` files to understand the CLI API and use cases.
3. Write the release body to `release-notes.md`. It should:
- Open with an enthusiastic one-paragraph summary of what's new or why this release is exciting.
- Have clearly labelled sections (e.g. **✨ New Features**, **🐛 Bug Fixes**, **⚡ Improvements**) — only include sections that actually have content.
- For any significant new feature, include a short shell example showing it in action.
- End with an installation snippet (`cargo install if-changed`).
- Be written in an upbeat, developer-friendly tone — celebrate the work!
Do NOT publish it yourself — a subsequent step will do that.
- name: Publish release notes
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b with:
tag_name: ${{ inputs.tag }}
body_path: release-notes.md