|
| 1 | +name: Claude Code - Rebase & Merge |
| 2 | +on: |
| 3 | + issue_comment: |
| 4 | + types: [created] |
| 5 | + pull_request_review_comment: |
| 6 | + types: [created] |
| 7 | + issues: |
| 8 | + types: [opened, assigned] |
| 9 | + pull_request_review: |
| 10 | + types: [submitted] |
| 11 | + |
| 12 | + |
| 13 | +jobs: |
| 14 | + claude: |
| 15 | + if: | |
| 16 | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, 'merge-master')) || |
| 17 | + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, 'merge-master')) || |
| 18 | + (github.event_name == 'pull_request_review' && contains(github.event.review.body, 'merge-master')) || |
| 19 | + (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, 'merge-master'))) |
| 20 | + runs-on: ubuntu-latest |
| 21 | + permissions: |
| 22 | + contents: write |
| 23 | + pull-requests: write |
| 24 | + issues: write |
| 25 | + id-token: write |
| 26 | + actions: read # Required for Claude to read CI results on PRs |
| 27 | + steps: |
| 28 | + - name: Checkout repository |
| 29 | + uses: actions/checkout@v5 |
| 30 | + with: |
| 31 | + fetch-depth: 1 |
| 32 | + |
| 33 | + - name: Run Claude Code |
| 34 | + id: claude |
| 35 | + uses: anthropics/claude-code-action@v1 |
| 36 | + with: |
| 37 | + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} |
| 38 | + prompt: | |
| 39 | + @agent-code-reviewer |
| 40 | + **GitHub PR Context:** |
| 41 | + - Repository: ${{ github.repository }} |
| 42 | + - PR Number: ${{ github.event.pull_request.number }} |
| 43 | + - Base Branch: ${{ github.event.pull_request.base.ref }} |
| 44 | + - Head Branch: ${{ github.event.pull_request.head.ref }} |
| 45 | + - PR Title: ${{ github.event.pull_request.title }} |
| 46 | +
|
| 47 | + **Your Task:** |
| 48 | + Base branch is master, You need to merge latest master branch into PR branch, |
| 49 | + Resolve if there are any merge conflicts while merging. |
| 50 | + Note: Do not push any changes to master branch, only push to PR branch if conflicts are resolved |
| 51 | + |
| 52 | + claude_args: "--allowedTools 'Edit,MultiEdit,Write,Read,Glob,Grep,LS,Bash(git:*),Bash(bun:*),Bash(npm:*),Bash(npx:*),Bash(gh:*)'" |
| 53 | + |
| 54 | + # Optional: Customize the trigger phrase (default: @claude) |
| 55 | + # trigger_phrase: "/claude" |
| 56 | + |
| 57 | + # Optional: Trigger when specific user is assigned to an issue |
| 58 | + # assignee_trigger: "claude-bot" |
| 59 | + |
| 60 | + # Optional: Configure Claude's behavior with CLI arguments |
| 61 | + # claude_args: | |
| 62 | + # --model claude-opus-4-1-20250805 |
| 63 | + # --max-turns 10 |
| 64 | + # --allowedTools "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)" |
| 65 | + # --system-prompt "Follow our coding standards. Ensure all new code has tests. Use TypeScript for new files." |
| 66 | + |
| 67 | + # Optional: Advanced settings configuration |
| 68 | + # settings: | |
| 69 | + # { |
| 70 | + # "env": { |
| 71 | + # "NODE_ENV": "test" |
| 72 | + # } |
| 73 | + # } |
0 commit comments