Skip to content

Commit 0e0bb01

Browse files
committed
Add or update GitHub Actions workflows
1 parent affbb72 commit 0e0bb01

1 file changed

Lines changed: 66 additions & 6 deletions

File tree

.github/workflows/ai-responder.yml

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,89 @@
11
---
2-
name: AI Issue Responder
2+
name: AI Issue and PR Responder
33

44
on:
55
issues:
66
types: [opened]
7+
pull_request:
8+
types: [opened]
79

810
permissions:
911
issues: write
12+
pull-requests: write
1013

1114
jobs:
12-
ai-respond:
13-
if: github.actor != 'dependabot[bot]'
15+
ai-respond-issue:
16+
if: github.event_name == 'issues' && github.actor != 'dependabot[bot]'
1417
runs-on: ubuntu-latest
1518

1619
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+
1734
- name: Download AI responder script
1835
run: |
1936
curl -sSL "https://raw.githubusercontent.com/dmzoneill/dmzoneill/main/ai-responder.py" -o ai-responder.py
2037
chmod +x ai-responder.py
2138
22-
- name: Run AI responder
39+
- name: Run AI responder for issue
2340
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 }}
2544
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2645
GITHUB_REPOSITORY: ${{ github.repository }}
2746
ISSUE_NUMBER: ${{ github.event.issue.number }}
2847
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

Comments
 (0)