Skip to content

Commit 2e51ae2

Browse files
authored
fix: auto-trigger polish release notes on release publish (Fission-AI#519)
* perf: add path filtering to Nix validation CI job Skip Nix flake validation when no Nix-related files change. This speeds up CI for PRs that only touch source code, docs, or tests. Files that trigger Nix validation: - flake.nix, flake.lock - package.json, pnpm-lock.yaml - scripts/update-flake.sh - .github/workflows/ci.yml Uses dorny/paths-filter@v3 for change detection. Required-checks jobs updated to handle skipped status correctly. * fix: auto-trigger polish release notes on release publish The workflow was only set up for manual dispatch, requiring someone to remember to run it after each release. This change adds an automatic trigger on `release: [published]` events while keeping the manual trigger as a fallback. The Claude Code Action supports any GitHub event when using the `prompt` parameter for custom automations.
1 parent dbd4ed7 commit 2e51ae2

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

.github/workflows/polish-release-notes.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
name: Polish Release Notes
22

3-
# Manual trigger after a release is published
4-
# The Claude Code action doesn't support 'release' event triggers directly
3+
# Automatically polish release notes when a release is published.
4+
# Also supports manual trigger as a fallback.
5+
#
6+
# Note: The Claude Code Action works with any GitHub event when using the
7+
# `prompt` parameter for custom automations. If release triggers stop working,
8+
# check https://github.com/anthropics/claude-code-action for updates.
59
on:
10+
release:
11+
types: [published]
612
workflow_dispatch:
713
inputs:
814
tag_name:
915
description: 'Release tag to polish (e.g., v0.18.0)'
1016
required: true
1117
type: string
1218

19+
env:
20+
TAG_NAME: ${{ github.event.release.tag_name || inputs.tag_name }}
21+
1322
permissions:
1423
contents: write
1524

@@ -27,8 +36,8 @@ jobs:
2736
env:
2837
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2938
run: |
30-
gh release view "${{ inputs.tag_name }}" --json body -q '.body' > current-notes.md
31-
echo "Fetched release notes for ${{ inputs.tag_name }}"
39+
gh release view "${{ env.TAG_NAME }}" --json body -q '.body' > current-notes.md
40+
echo "Fetched release notes for ${{ env.TAG_NAME }}"
3241
3342
- name: Transform release notes with Claude
3443
uses: anthropics/claude-code-action@v1
@@ -38,7 +47,7 @@ jobs:
3847
github_token: ${{ secrets.GITHUB_TOKEN }}
3948
claude_args: "--allowedTools Write,Read"
4049
prompt: |
41-
Transform the changelog in `current-notes.md` into release notes for OpenSpec ${{ inputs.tag_name }}.
50+
Transform the changelog in `current-notes.md` into release notes for OpenSpec ${{ env.TAG_NAME }}.
4251
4352
## Voice
4453
@@ -55,7 +64,7 @@ jobs:
5564
5665
A short title in this format:
5766
```
58-
${{ inputs.tag_name }} - [1-4 words describing the release]
67+
${{ env.TAG_NAME }} - [1-4 words describing the release]
5968
```
6069
6170
Examples:
@@ -72,7 +81,7 @@ jobs:
7281
### 2. `polished-notes.md`
7382
7483
```markdown
75-
## What's New in ${{ inputs.tag_name }}
84+
## What's New in ${{ env.TAG_NAME }}
7685
7786
[One sentence: what's the theme of this release?]
7887
@@ -129,7 +138,7 @@ jobs:
129138
env:
130139
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
131140
run: |
132-
TAG="${{ inputs.tag_name }}"
141+
TAG="${{ env.TAG_NAME }}"
133142
134143
if [ -f "polished-notes.md" ] && [ -f "release-title.txt" ]; then
135144
TITLE=$(cat release-title.txt)

0 commit comments

Comments
 (0)