Skip to content

Commit 92a7cc7

Browse files
authored
Merge pull request cloudflare#267 from cloudflare/nightly
Release: Nightly -> Main
2 parents 974c8e0 + 96168d5 commit 92a7cc7

307 files changed

Lines changed: 32553 additions & 11605 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ai-changelog.yml

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
name: AI Changelog (Claude)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag_name:
7+
description: 'Release tag to enrich'
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: write
13+
id-token: write
14+
15+
concurrency:
16+
group: ai-changelog-${{ inputs.tag_name }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
ai-changelog:
21+
runs-on: ubuntu-latest
22+
env:
23+
ANTHROPIC_BASE_URL: ${{ secrets.ANTHROPIC_BASE_URL }}
24+
ANTHROPIC_CUSTOM_HEADERS: ${{ secrets.ANTHROPIC_CUSTOM_HEADERS }}
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Get previous tag
32+
id: prev_tag
33+
run: |
34+
CURRENT_TAG='${{ inputs.tag_name }}'
35+
PREV_TAG=$(git describe --tags --abbrev=0 "${CURRENT_TAG}^" 2>/dev/null || echo '')
36+
echo "current_tag=$CURRENT_TAG" >> "$GITHUB_OUTPUT"
37+
echo "previous_tag=$PREV_TAG" >> "$GITHUB_OUTPUT"
38+
39+
- name: Generate enhanced changelog with Claude Code Action
40+
uses: anthropics/claude-code-action@v1
41+
env:
42+
GH_TOKEN: ${{ github.token }}
43+
with:
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
46+
prompt: |
47+
Generate an enhanced changelog for release ${{ inputs.tag_name }}.
48+
49+
IMPORTANT:
50+
- This workflow is triggered via workflow_dispatch because claude-code-action does not support push events.
51+
- Use the existing release-please notes as a starting point, but rewrite for clarity and context.
52+
53+
**Step 1: Collect data**
54+
55+
Get release-please's generated changelog:
56+
```bash
57+
gh release view "${{ inputs.tag_name }}" --json body -q .body > /tmp/release-please-changelog.txt
58+
cat /tmp/release-please-changelog.txt
59+
```
60+
61+
Get all commits with full messages (not just titles):
62+
```bash
63+
PREV_TAG='${{ steps.prev_tag.outputs.previous_tag }}'
64+
if [ -n "$PREV_TAG" ]; then
65+
git log "$PREV_TAG...${{ inputs.tag_name }}" --pretty=format:"### Commit: %s%n%b%n---" | head -c 50000 > /tmp/commits.txt
66+
else
67+
git log "${{ inputs.tag_name }}" --pretty=format:"### Commit: %s%n%b%n---" | head -c 50000 > /tmp/commits.txt
68+
fi
69+
cat /tmp/commits.txt
70+
```
71+
72+
Get merged PRs with descriptions:
73+
```bash
74+
PREV_TAG='${{ steps.prev_tag.outputs.previous_tag }}'
75+
if [ -n "$PREV_TAG" ]; then
76+
PREV_DATE=$(git log -1 --format=%aI "$PREV_TAG" 2>/dev/null || echo "2024-01-01T00:00:00Z")
77+
else
78+
PREV_DATE="2024-01-01T00:00:00Z"
79+
fi
80+
81+
gh pr list \
82+
--repo ${{ github.repository }} \
83+
--state merged \
84+
--json number,title,body,mergedAt \
85+
--limit 50 \
86+
--search "merged:>=$PREV_DATE" \
87+
--jq '.[] | "## PR #\(.number): \(.title)\n\(.body)\n---\n"' > /tmp/prs.txt 2>/dev/null || echo "No PRs found" > /tmp/prs.txt
88+
cat /tmp/prs.txt
89+
```
90+
91+
Get diff statistics and file list:
92+
```bash
93+
PREV_TAG='${{ steps.prev_tag.outputs.previous_tag }}'
94+
if [ -n "$PREV_TAG" ]; then
95+
git diff "$PREV_TAG...${{ inputs.tag_name }}" --shortstat > /tmp/stats.txt
96+
git diff "$PREV_TAG...${{ inputs.tag_name }}" --name-only | head -c 50000 > /tmp/files.txt
97+
else
98+
git log --shortstat --oneline | head -1 > /tmp/stats.txt
99+
git show --name-only --pretty='' "${{ inputs.tag_name }}" | head -c 50000 > /tmp/files.txt
100+
fi
101+
cat /tmp/stats.txt
102+
echo "\n--- Files changed (truncated) ---"
103+
cat /tmp/files.txt
104+
```
105+
106+
**Step 2: Generate enhanced changelog**
107+
108+
Using the data above (release-please changelog, commit messages, PR descriptions, stats):
109+
110+
1. Use release-please's changelog as the base structure, but rewrite entries with more context.
111+
2. Prefer PR descriptions over commit titles when available (more accurate intent).
112+
3. Add "What/Why/Impact" for each meaningful change.
113+
4. Group by product area where possible (Frontend, Worker/API, Sandbox/Containers, Docs, Tooling).
114+
5. Include PR numbers for traceability (e.g. "(#123)").
115+
6. Keep it concise: 1-2 bullets per PR unless truly major.
116+
7. No emojis in the changelog.
117+
118+
Format:
119+
```markdown
120+
## Release ${{ inputs.tag_name }}
121+
122+
### Highlights
123+
- 2-4 bullets: biggest user-visible improvements
124+
125+
### Changes
126+
127+
#### Frontend
128+
- ...
129+
130+
#### Worker / API
131+
- ...
132+
133+
#### Sandbox / Containers
134+
- ...
135+
136+
#### Tooling / CI
137+
- ...
138+
139+
#### Documentation
140+
- ...
141+
142+
### Breaking Changes
143+
- If any, include migration notes
144+
145+
### Statistics
146+
- Include git diff shortstat
147+
- Mention top-level areas touched (from file list)
148+
```
149+
150+
**Step 3: Save the enhanced changelog**
151+
```bash
152+
cat > /tmp/enhanced-changelog.md << 'CHANGELOG_EOF'
153+
[PASTE YOUR GENERATED CHANGELOG HERE]
154+
CHANGELOG_EOF
155+
```
156+
157+
**Step 4: Update the release**
158+
```bash
159+
gh release edit "${{ inputs.tag_name }}" --notes-file /tmp/enhanced-changelog.md
160+
echo "Release notes updated successfully"
161+
```
162+
163+
claude_args: |
164+
--allowed-tools "Bash(gh release view:*),Bash(gh release edit:*),Bash(gh pr list:*),Bash(git log:*),Bash(git diff:*),Bash(git show:*),Bash(cat:*),Bash(echo:*),Bash(head:*)"
165+
--max-turns 20
166+
--model claude-opus-4-5-20251101
167+
168+
- name: Verify changelog updated
169+
if: always()
170+
env:
171+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
172+
run: |
173+
TAG_NAME='${{ inputs.tag_name }}'
174+
echo "Verifying release notes for $TAG_NAME..."
175+
gh release view "$TAG_NAME" --json body -q .body | head -20
176+
echo "Changelog verification complete"

.github/workflows/ci.yml

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,52 @@
11
name: CI
22

33
on:
4-
push:
5-
branches: [ "**" ] # Run on all branches
64
pull_request:
7-
branches: [ main ]
5+
branches: [main, nightly]
6+
push:
7+
branches: [main, nightly]
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: true
815

916
jobs:
10-
build:
17+
ci:
1118
runs-on: ubuntu-latest
19+
env:
20+
CI: true
1221

1322
steps:
14-
- name: Checkout repository
15-
uses: actions/checkout@v4
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Bun
27+
uses: oven-sh/setup-bun@v1
28+
with:
29+
bun-version: latest
30+
31+
- name: Cache Bun install cache
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.bun/install/cache
35+
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-bun-
1638
17-
- name: Setup Bun
18-
uses: oven-sh/setup-bun@v1
19-
with:
20-
bun-version: latest
39+
- name: Install dependencies
40+
run: bun install --frozen-lockfile
2141

22-
- name: Install dependencies
23-
run: bun install --frozen-lockfile
42+
- name: Lint
43+
run: bun run lint
2444

25-
- name: Run build
26-
run: bun run build
45+
- name: Typecheck
46+
run: bun run typecheck
2747

28-
# - name: Run linter
29-
# run: bun run lint
48+
- name: Test
49+
run: bun run test
3050

31-
# - name: Run tests
32-
# run: bun run test
51+
- name: Build
52+
run: bun run build

0 commit comments

Comments
 (0)