Skip to content

Commit e66669e

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

1 file changed

Lines changed: 6 additions & 42 deletions

File tree

.github/workflows/ai-responder.yml

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ permissions:
1212
pull-requests: write
1313

1414
jobs:
15-
ai-respond-issue:
16-
if: github.event_name == 'issues' && github.actor != 'dependabot[bot]'
15+
ai-respond:
16+
if: github.actor != 'dependabot[bot]'
1717
runs-on: ubuntu-latest
1818

1919
steps:
@@ -36,54 +36,18 @@ jobs:
3636
curl -sSL "https://raw.githubusercontent.com/dmzoneill/dmzoneill/main/ai-responder.py" -o ai-responder.py
3737
chmod +x ai-responder.py
3838
39-
- name: Run AI responder for issue
39+
- name: Run AI responder
4040
env:
4141
GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcloud-credentials.json
4242
ANTHROPIC_VERTEX_PROJECT_ID: ${{ secrets.ANTHROPIC_VERTEX_PROJECT_ID }}
4343
CLAUDE_CODE_USE_VERTEX: ${{ secrets.CLAUDE_CODE_USE_VERTEX }}
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4545
GITHUB_REPOSITORY: ${{ github.repository }}
46-
ISSUE_NUMBER: ${{ github.event.issue.number }}
46+
ISSUE_NUMBER: ${{ github.event_name == 'issues' && github.event.issue.number || '' }}
47+
PR_NUMBER: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || '' }}
4748
ISSUE_REPO_URL: "https://github.com/${{ github.repository }}"
48-
EVENT_TYPE: issue
49+
EVENT_TYPE: ${{ github.event_name == 'issues' && 'issue' || 'pull_request' }}
4950
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
5051
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 }}
8852
TELEGRAM_PR_CHAT_ID: ${{ secrets.TELEGRAM_PR_CHAT_ID }}
8953
run: python ai-responder.py

0 commit comments

Comments
 (0)