Skip to content

Commit 0d12557

Browse files
committed
ci: summarize api changes with claude
1 parent 9e8216f commit 0d12557

File tree

3 files changed

+20
-59
lines changed

3 files changed

+20
-59
lines changed

.github/workflows/claude-code-review.yml

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

.github/workflows/claude.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Claude Code
22

33
on:
4+
pull_request:
5+
types: [opened]
46
issue_comment:
57
types: [created]
68
pull_request_review_comment:
@@ -21,13 +23,9 @@ jobs:
2123
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
2224
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
2325
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
24-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
25-
) &&
26-
contains(
27-
fromJSON('["OWNER","MEMBER","COLLABORATOR"]'),
28-
(github.event.comment.author_association || github.event.review.author_association || github.event.issue.author_association)
29-
) &&
30-
!endsWith(github.actor, '[bot]')
26+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) ||
27+
(github.event_name == 'pull_request' && contains(github.event.pull_request.body, '@claude'))
28+
)
3129
runs-on: ubuntu-latest
3230
permissions:
3331
contents: write
@@ -49,3 +47,4 @@ jobs:
4947
claude_args: |
5048
--max-turns 20
5149
--allowed-tools "Bash(gh api:*),Bash(gh issue close:*),Bash(gh issue comment:*),Bash(gh issue create:*),Bash(gh issue list:*),Bash(gh issue reopen:*),Bash(gh issue view:*),Bash(gh pr close:*),Bash(gh pr comment:*),Bash(gh pr create:*),Bash(gh pr diff:*),Bash(gh pr list:*),Bash(gh pr merge:*),Bash(gh pr view:*),Bash(gh search:*)"
50+
--system-prompt 'Relaxed, direct, still professional tone. Be concise. No emojis.'

.github/workflows/update-amazon-models.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,23 +99,32 @@ jobs:
9999
const prTitle = `feat: update amazon models`;
100100
101101
// Build PR body with character limit handling
102+
const apiList = apiUpdates.join(', ') || 'various APIs';
102103
const baseBody = `This PR was automatically generated to update the Amazon SP-API models.
103104
104-
Changes include:
105+
**APIs affected:** ${apiList}
106+
107+
**Changes include:**
105108
`;
106109
110+
const claudePrompt = `
111+
112+
---
113+
114+
@claude Summarize the changes - what's new, what's removed, and any breaking changes.`;
115+
107116
const maxLength = 65536;
108117
const truncationMessage = '(truncated due to length)';
109118
110119
let filesList = changedFiles.map(file => `- ${file}`).join('\n');
111120
112-
// Calculate max allowed length for the complete body
121+
// Calculate max allowed length for the complete body (including Claude prompt)
113122
const maxBodyLength = maxLength;
114-
const currentLength = baseBody.length + filesList.length;
123+
const currentLength = baseBody.length + filesList.length + claudePrompt.length;
115124
116125
// Truncate if necessary
117126
if (currentLength > maxBodyLength) {
118-
const maxFilesListLength = maxBodyLength - baseBody.length - truncationMessage.length;
127+
const maxFilesListLength = maxBodyLength - baseBody.length - claudePrompt.length - truncationMessage.length;
119128
filesList = filesList.substring(0, maxFilesListLength);
120129
// Find the last complete line
121130
const lastNewline = filesList.lastIndexOf('\n');
@@ -125,7 +134,7 @@ jobs:
125134
filesList += truncationMessage;
126135
}
127136
128-
const prBody = baseBody + filesList;
137+
const prBody = baseBody + filesList + claudePrompt;
129138
130139
// Create PR using GitHub API
131140
const { data: pr } = await github.rest.pulls.create({

0 commit comments

Comments
 (0)