-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.41 KB
/
agent.yml
File metadata and controls
56 lines (48 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Code Explainer Bot
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
run-agent:
if: |
contains(github.event.comment.body, '@gitagent explain') ||
contains(github.event.comment.body, '@gitagent test')
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
contents: read
steps:
- name: Checkout agent
uses: actions/checkout@v4
with:
repository: hkv-31/Code-Explainer-Git-Agent
path: agent
- name: Checkout target repo
uses: actions/checkout@v4
with:
path: repo
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install agent dependencies
run: cd agent && npm install
- name: Write payload to file
env:
PAYLOAD: ${{ toJson(github.event) }}
run: echo "$PAYLOAD" > /tmp/payload.json
- name: Run agent
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
run: |
cd agent && node --input-type=module << 'EOF'
import fs from 'fs';
const payload = JSON.parse(fs.readFileSync('/tmp/payload.json', 'utf8'));
const { run } = await import('./index.js');
await run(payload);
process.exit(0);
EOF