Skip to content

Commit 3a7c8e9

Browse files
z4nr34lclaude
andcommitted
feat(ci): generate changelogs with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9169c59 commit 3a7c8e9

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/publish.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
1719

1820
- uses: docker/login-action@v3
1921
with:
@@ -43,8 +45,26 @@ jobs:
4345
cache-from: type=gha
4446
cache-to: type=gha,mode=max
4547

48+
- name: Generate changelog with Claude Code
49+
id: changelog
50+
env:
51+
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
52+
TAG_NAME: ${{ github.ref_name }}
53+
run: |
54+
npm install -g @anthropic-ai/claude-code
55+
PREV_TAG=$(git tag --sort=-v:refname | grep '^v' | sed -n '2p')
56+
DIFF=$(git log --oneline "${PREV_TAG}..${TAG_NAME}" 2>/dev/null || git log --oneline -20)
57+
CHANGELOG=$(echo "$DIFF" | claude -p \
58+
"Generate a concise changelog for release ${TAG_NAME} of a devcontainer project. Group changes by category (Features, Fixes, Docs, Chores). Use markdown with bullet points. No preamble, just the changelog. Here are the commits:" \
59+
--output-format text)
60+
{
61+
echo "body<<CHANGELOG_EOF"
62+
echo "$CHANGELOG"
63+
echo "CHANGELOG_EOF"
64+
} >> "$GITHUB_OUTPUT"
65+
4666
- name: Create GitHub Release
4767
env:
4868
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4969
TAG_NAME: ${{ github.ref_name }}
50-
run: gh release create "$TAG_NAME" --generate-notes
70+
run: gh release create "$TAG_NAME" --notes "${{ steps.changelog.outputs.body }}"

0 commit comments

Comments
 (0)