Skip to content

Commit e9aadb8

Browse files
committed
feat(ci): auto-merge codeflash optimization PRs when CI passes
1 parent 09aede2 commit e9aadb8

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/claude.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,18 @@ jobs:
156156
2. If found, UPDATE it: `gh api --method PATCH repos/${{ github.repository }}/issues/comments/<ID> -f body="<content>"`
157157
3. If not found, CREATE: `gh pr comment ${{ github.event.pull_request.number }} --body "<content>"`
158158
4. Delete any OTHER claude[bot] comments to clean up duplicates: `gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments --jq '.[] | select(.user.login == "claude[bot]") | .id' | tail -n +2 | xargs -I {} gh api --method DELETE repos/${{ github.repository }}/issues/comments/{}`
159-
claude_args: '--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh issue view:*),Bash(gh issue list:*),Bash(gh api:*),Bash(uv run prek *),Bash(uv run mypy *),Bash(uv run coverage *),Bash(uv run pytest *),Bash(git status*),Bash(git add *),Bash(git commit *),Bash(git push*),Bash(git diff *),Bash(git checkout *),Read,Glob,Grep,Edit"'
159+
160+
## STEP 5: Merge pending codeflash optimization PRs
161+
162+
Check for open optimization PRs from codeflash and merge if CI passes:
163+
164+
1. List open PRs from codeflash bot:
165+
`gh pr list --author "codeflash-ai[bot]" --state open --json number,title,headRefName`
166+
167+
2. For each optimization PR:
168+
- Check if CI is passing: `gh pr checks <number>`
169+
- If all checks pass, merge it: `gh pr merge <number> --squash --delete-branch`
170+
claude_args: '--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh pr checks:*),Bash(gh pr merge:*),Bash(gh issue view:*),Bash(gh issue list:*),Bash(gh api:*),Bash(uv run prek *),Bash(uv run mypy *),Bash(uv run coverage *),Bash(uv run pytest *),Bash(git status*),Bash(git add *),Bash(git commit *),Bash(git push*),Bash(git diff *),Bash(git checkout *),Read,Glob,Grep,Edit"'
160171
additional_permissions: |
161172
actions: read
162173
env:

0 commit comments

Comments
 (0)