|
1 | 1 | --- |
2 | | -name: AI Issue Responder |
| 2 | +name: AI Issue and PR Responder |
3 | 3 |
|
4 | 4 | on: |
5 | 5 | issues: |
6 | 6 | types: [opened] |
| 7 | + pull_request: |
| 8 | + types: [opened] |
7 | 9 |
|
8 | 10 | permissions: |
9 | 11 | issues: write |
| 12 | + pull-requests: write |
10 | 13 |
|
11 | 14 | jobs: |
12 | | - ai-respond: |
13 | | - if: github.actor != 'dependabot[bot]' |
| 15 | + ai-respond-issue: |
| 16 | + if: github.event_name == 'issues' && github.actor != 'dependabot[bot]' |
14 | 17 | runs-on: ubuntu-latest |
15 | 18 |
|
16 | 19 | steps: |
| 20 | + - name: Setup Node.js |
| 21 | + uses: actions/setup-node@v4 |
| 22 | + with: |
| 23 | + node-version: '20' |
| 24 | + |
| 25 | + - name: Install Claude CLI |
| 26 | + run: npm install -g @anthropic-ai/claude-code |
| 27 | + |
| 28 | + - name: Setup Google Cloud credentials |
| 29 | + run: echo '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }}' > /tmp/gcloud-credentials.json |
| 30 | + |
| 31 | + - name: Install Python dependencies |
| 32 | + run: pip install requests |
| 33 | + |
17 | 34 | - name: Download AI responder script |
18 | 35 | run: | |
19 | 36 | curl -sSL "https://raw.githubusercontent.com/dmzoneill/dmzoneill/main/ai-responder.py" -o ai-responder.py |
20 | 37 | chmod +x ai-responder.py |
21 | 38 |
|
22 | | - - name: Run AI responder |
| 39 | + - name: Run AI responder for issue |
23 | 40 | env: |
24 | | - OPENAI_API_KEY: ${{ secrets.AI_API_KEY }} |
| 41 | + GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcloud-credentials.json |
| 42 | + ANTHROPIC_VERTEX_PROJECT_ID: ${{ secrets.ANTHROPIC_VERTEX_PROJECT_ID }} |
| 43 | + CLAUDE_CODE_USE_VERTEX: ${{ secrets.CLAUDE_CODE_USE_VERTEX }} |
25 | 44 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
26 | 45 | GITHUB_REPOSITORY: ${{ github.repository }} |
27 | 46 | ISSUE_NUMBER: ${{ github.event.issue.number }} |
28 | 47 | ISSUE_REPO_URL: "https://github.com/${{ github.repository }}" |
29 | | - run: ./ai-responder.py |
| 48 | + EVENT_TYPE: issue |
| 49 | + TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} |
| 50 | + TELEGRAM_ISSUES_CHAT_ID: ${{ secrets.TELEGRAM_ISSUES_CHAT_ID }} |
| 51 | + run: python ai-responder.py |
| 52 | + |
| 53 | + ai-respond-pr: |
| 54 | + if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' |
| 55 | + runs-on: ubuntu-latest |
| 56 | + |
| 57 | + steps: |
| 58 | + - name: Setup Node.js |
| 59 | + uses: actions/setup-node@v4 |
| 60 | + with: |
| 61 | + node-version: '20' |
| 62 | + |
| 63 | + - name: Install Claude CLI |
| 64 | + run: npm install -g @anthropic-ai/claude-code |
| 65 | + |
| 66 | + - name: Setup Google Cloud credentials |
| 67 | + run: echo '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }}' > /tmp/gcloud-credentials.json |
| 68 | + |
| 69 | + - name: Install Python dependencies |
| 70 | + run: pip install requests |
| 71 | + |
| 72 | + - name: Download AI responder script |
| 73 | + run: | |
| 74 | + curl -sSL "https://raw.githubusercontent.com/dmzoneill/dmzoneill/main/ai-responder.py" -o ai-responder.py |
| 75 | + chmod +x ai-responder.py |
| 76 | +
|
| 77 | + - name: Run AI responder for PR |
| 78 | + env: |
| 79 | + GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcloud-credentials.json |
| 80 | + ANTHROPIC_VERTEX_PROJECT_ID: ${{ secrets.ANTHROPIC_VERTEX_PROJECT_ID }} |
| 81 | + CLAUDE_CODE_USE_VERTEX: ${{ secrets.CLAUDE_CODE_USE_VERTEX }} |
| 82 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 83 | + GITHUB_REPOSITORY: ${{ github.repository }} |
| 84 | + PR_NUMBER: ${{ github.event.pull_request.number }} |
| 85 | + ISSUE_REPO_URL: "https://github.com/${{ github.repository }}" |
| 86 | + EVENT_TYPE: pull_request |
| 87 | + TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} |
| 88 | + TELEGRAM_PR_CHAT_ID: ${{ secrets.TELEGRAM_PR_CHAT_ID }} |
| 89 | + run: python ai-responder.py |
0 commit comments