Skip to content

Commit c79555a

Browse files
kronosapiensclaude
andcommitted
fix: inline changelog generation into release-dispatch workflow
The changelog-generation workflow ran as a separate job after the release PR was created, pushing a second commit to the PR branch. This caused a race condition where the test/quality CI checks would run on the first commit but not re-trigger on the changelog commit, leaving required status checks permanently pending and blocking the PR from merging. Move changelog generation into release-dispatch before PR creation so that peter-evans/create-pull-request includes both version bumps and changelog in a single commit. Delete the now-unnecessary changelog-generation workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 85cf71a commit c79555a

File tree

2 files changed

+51
-108
lines changed

2 files changed

+51
-108
lines changed

.github/workflows/changelog-generation.yml

Lines changed: 0 additions & 108 deletions
This file was deleted.

.github/workflows/release-dispatch.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
2628
- name: Configure Git
2729
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
2830
- name: Set up Node.js
@@ -38,6 +40,55 @@ jobs:
3840
run: |
3941
VERSION=${{ github.event.inputs.version }}
4042
pnpm -r exec -- bash -c "npm version $VERSION --no-git-tag-version"
43+
44+
- name: Get commit range for changelog
45+
id: commit_range
46+
run: |
47+
LATEST_TAG=$(gh release list --limit 1 --exclude-pre-releases --exclude-drafts --json tagName --jq '.[0].tagName' || echo "")
48+
if [ -z "$LATEST_TAG" ]; then
49+
LATEST_TAG=$(git log --oneline -n 50 | tail -1 | cut -d' ' -f1)
50+
fi
51+
echo "RANGE=${LATEST_TAG}..HEAD" >> $GITHUB_OUTPUT
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Generate Changelog with Claude
56+
id: changelog
57+
uses: anthropics/claude-code-action@beta
58+
with:
59+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
60+
github_token: ${{ secrets.GITHUB_TOKEN }}
61+
direct_prompt: |
62+
Generate a changelog entry for version ${{ github.event.inputs.version }} of the Cartridge Controller SDK.
63+
64+
This is a monorepo containing:
65+
- @cartridge/controller - Main SDK implementing Starknet account interfaces
66+
- @cartridge/connector - Lightweight connector interface for Starknet React applications
67+
68+
Analyze the git commit range: ${{ steps.commit_range.outputs.RANGE }}
69+
70+
Create a changelog entry in this format and update CHANGELOG.md:
71+
72+
## [${{ github.event.inputs.version }}] - $(date +%Y-%m-%d)
73+
74+
### ✨ New Features
75+
- [List new features with brief descriptions]
76+
77+
### 🚀 Improvements
78+
- [List improvements and enhancements]
79+
80+
### 🐛 Bug Fixes
81+
- [List bug fixes]
82+
83+
### ⚠️ Breaking Changes
84+
- [List any breaking changes with migration guidance]
85+
86+
### 📦 Dependencies
87+
- [List significant dependency updates]
88+
89+
Focus on user-facing changes and be professional. Group changes by package (@cartridge/controller vs @cartridge/connector) when relevant.
90+
allowed_tools: "Read,Write,Bash"
91+
4192
- name: Create Release Pull Request
4293
if: ${{ github.event.inputs.tag == 'latest' }}
4394
id: cpr

0 commit comments

Comments
 (0)