Skip to content

Commit 2beb8e7

Browse files
authored
test: add temporary workflow to validate repository_dispatch (Fission-AI#542)
This is a dry-run workflow to test repository_dispatch before modifying the release pipeline. Will be deleted after validation.
1 parent 3b16b13 commit 2beb8e7

1 file changed

Lines changed: 133 additions & 0 deletions

File tree

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Test Polish Dispatch
2+
3+
# Temporary workflow to test repository_dispatch before modifying release pipeline.
4+
# Delete this file after validation.
5+
6+
on:
7+
repository_dispatch:
8+
types: [test-polish-notes]
9+
workflow_dispatch:
10+
inputs:
11+
tag_name:
12+
description: 'Release tag to test (e.g., v0.23.0)'
13+
required: true
14+
type: string
15+
16+
env:
17+
# repository_dispatch passes tag via client_payload, workflow_dispatch via inputs
18+
TAG_NAME: ${{ github.event.client_payload.tag_name || inputs.tag_name }}
19+
20+
permissions:
21+
contents: write
22+
23+
jobs:
24+
test-polish:
25+
if: github.repository == 'Fission-AI/OpenSpec'
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Debug context
32+
run: |
33+
echo "Event name: ${{ github.event_name }}"
34+
echo "Tag name: ${{ env.TAG_NAME }}"
35+
36+
- name: Get current release body
37+
id: get-release
38+
env:
39+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
run: |
41+
gh release view "${{ env.TAG_NAME }}" --json body -q '.body' > current-notes.md
42+
echo "Fetched release notes for ${{ env.TAG_NAME }}"
43+
echo "--- Content preview ---"
44+
head -20 current-notes.md
45+
46+
- name: Transform release notes with Claude
47+
uses: anthropics/claude-code-action@v1
48+
id: claude
49+
with:
50+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
51+
github_token: ${{ secrets.GITHUB_TOKEN }}
52+
claude_args: "--allowedTools Write,Read"
53+
prompt: |
54+
Transform the changelog in `current-notes.md` into release notes for OpenSpec ${{ env.TAG_NAME }}.
55+
56+
## Voice
57+
58+
OpenSpec is a developer tool. Write like you're talking to a peer:
59+
- Direct and practical, not marketing copy
60+
- Focus on what changed and why it matters
61+
- Skip the hype, keep it real
62+
63+
## Output
64+
65+
Create two files:
66+
67+
### 1. `release-title.txt`
68+
69+
A short title in this format:
70+
```
71+
${{ env.TAG_NAME }} - [1-4 words describing the release]
72+
```
73+
74+
Examples:
75+
- `v0.18.0 - OPSX Experimental Workflow`
76+
- `v0.16.0 - Antigravity, iFlow Support`
77+
- `v0.15.0 - Gemini CLI, RooCode`
78+
79+
Rules for title:
80+
- Lead with the most notable addition
81+
- 1-4 words after the dash, no fluff
82+
- If multiple features, comma-separate the top 2
83+
- For bugfix-only releases, use something like `v0.17.2 - Pre-commit Hook Fix`
84+
85+
### 2. `polished-notes.md`
86+
87+
```markdown
88+
## What's New in ${{ env.TAG_NAME }}
89+
90+
[One sentence: what's the theme of this release?]
91+
92+
### New
93+
94+
- **Feature name** - What it does and why you'd use it
95+
96+
### Improved
97+
98+
- **Area** - What got better
99+
100+
### Fixed
101+
102+
- What was broken, now works
103+
```
104+
105+
Omit empty sections.
106+
107+
## Rules
108+
109+
1. Write for developers using OpenSpec with AI coding assistants
110+
2. Remove commit hashes (like `eb152eb:`), PR numbers, and changesets wrappers (`### Minor Changes`)
111+
3. Lead with what users can do, not implementation details
112+
4. One to two sentences per item, max
113+
5. Use **bold** for feature/area names
114+
6. Skip internal changes (CI, refactors, tests) unless they affect users
115+
7. If the input is already well-formatted, just clean up structure and remove noise
116+
117+
Write both files. No other output.
118+
119+
- name: Show results (dry run - no actual update)
120+
run: |
121+
echo "=== DRY RUN - Would update release ${{ env.TAG_NAME }} ==="
122+
echo ""
123+
if [ -f "release-title.txt" ]; then
124+
echo "--- Title ---"
125+
cat release-title.txt
126+
echo ""
127+
fi
128+
if [ -f "polished-notes.md" ]; then
129+
echo "--- Notes ---"
130+
cat polished-notes.md
131+
fi
132+
echo ""
133+
echo "=== Test complete. If this looks good, the real workflow will work. ==="

0 commit comments

Comments
 (0)