Skip to content

Commit 95528ec

Browse files
authored
feat: use claude to generate changelog instead gemini (#530)
1 parent ce27724 commit 95528ec

3 files changed

Lines changed: 21 additions & 136 deletions

File tree

.gemini/commands/release/changelog-write.toml

Lines changed: 0 additions & 102 deletions
This file was deleted.
Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
1-
description = "Generate a public Russian changelog for the RPG game from a git ref up to HEAD"
2-
3-
prompt = '''
41
You are preparing public release notes for an RPG game.
5-
62
The user passes exactly one git ref in this format:
7-
83
<from_ref>
9-
104
The changelog range must be:
115
<from_ref>..HEAD
126

13-
User input:
14-
{{args}}
7+
<user_input>
8+
__ARGS__
9+
</user_input>
1510

16-
First inspect the git range below.
17-
18-
!{bash -lc '
11+
First, inspect the git range by running this bash command:
12+
```bash
1913
set -euo pipefail
20-
set -- {{args}}
21-
22-
FROM="${1:-}"
14+
FROM="__ARGS__"
2315
TO="HEAD"
2416

2517
if [ -z "$FROM" ]; then
@@ -39,11 +31,11 @@ git log "$FROM..$TO" \
3931
--no-merges \
4032
--reverse \
4133
--pretty=format:"---COMMIT---%nHASH: %H%nSUBJECT: %s%nBODY:%n%b"
42-
4334
echo
35+
4436
echo "=== FILES CHANGED ==="
4537
git diff --name-only "$FROM..$TO" | sed "s/^/- /"
46-
'}
38+
```
4739

4840
Your job:
4941
1. Read the commit list for the requested range.
@@ -76,8 +68,7 @@ Your job:
7668

7769
Output format:
7870
- Title: Changelog
79-
- Then a short section: Кратко with 2 to 5 bullets
71+
- Then a short section: **Кратко** with 2 to 5 bullets
8072
- Then the detailed grouped changelog
8173
- Keep it concise but readable
82-
- Use Markdown only
83-
'''
74+
- Use Markdown only

.github/workflows/write-changelog.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,24 @@ permissions:
2222
jobs:
2323
changelog:
2424
runs-on: ubuntu-latest
25-
2625
steps:
2726
- name: Checkout repository
28-
uses: actions/checkout@v6
27+
uses: actions/checkout@v4
2928
with:
3029
fetch-depth: 0
3130
ref: ${{ github.ref_name }}
3231

33-
- name: Run Gemini to update CHANGELOG.md
34-
uses: google-github-actions/run-gemini-cli@v0
32+
- name: Prepare prompt
33+
run: |
34+
sed 's|__ARGS__|${{ inputs.from_ref }}|g' \
35+
.github/prompts/changelog.md > /tmp/changelog-prompt.md
36+
37+
- name: Run Claude to update CHANGELOG.md
38+
uses: anthropics/claude-code-action@beta
3539
with:
36-
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
37-
prompt: >
38-
/release:changelog-write
39-
${{ inputs.from_ref }}
40-
HEAD
41-
settings: >
42-
{
43-
"sandbox": false
44-
}
40+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
41+
allowed_tools: "Bash,Read,Write"
42+
prompt_file: /tmp/changelog-prompt.md
4543

4644
- name: Show diff
4745
run: git diff -- CHANGELOG.md
@@ -50,12 +48,10 @@ jobs:
5048
if: ${{ inputs.commit_changes == 'true' }}
5149
run: |
5250
set -euo pipefail
53-
5451
if git diff --quiet -- CHANGELOG.md; then
5552
echo "No changes in CHANGELOG.md"
5653
exit 0
5754
fi
58-
5955
git config user.name "github-actions[bot]"
6056
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
6157
git add CHANGELOG.md

0 commit comments

Comments
 (0)