-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (83 loc) · 3.12 KB
/
Copy pathreflexion-issue-runner.yml
File metadata and controls
96 lines (83 loc) · 3.12 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Reflexion Issue Runner
on:
issues:
types: [labeled]
issue_comment:
types: [created]
workflow_dispatch:
inputs:
issue_number:
description: 'Issue number to run against'
required: true
type: number
concurrency:
group: reflexion-${{ github.event.issue.number || github.event.inputs.issue_number }}
cancel-in-progress: false
permissions:
issues: write
actions: read
contents: read
jobs:
run-reflexion:
runs-on: ubuntu-latest
if: >-
(github.event_name == 'issues' && github.event.action == 'labeled' && github.event.label.name == 'reflexion:run') ||
(github.event_name == 'issue_comment' && github.event.action == 'created' && startsWith(github.event.comment.body, '/reflexion')) ||
(github.event_name == 'workflow_dispatch')
steps:
- name: Check Secrets
id: check_secrets
run: |
if [ -z "${{ secrets.GEMINI_API_KEY }}" ] || [ -z "${{ secrets.ANTHROPIC_API_KEY }}" ]; then
echo "Missing required API keys in secrets."
ISSUE_NUM="${{ github.event.issue.number || github.event.inputs.issue_number }}"
if [ -n "$ISSUE_NUM" ]; then
curl -s -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUM/comments \
-d '{"body":"### 🚨 Reflexion Loop Error\nMissing required `GEMINI_API_KEY` or `ANTHROPIC_API_KEY` in repository secrets."}'
fi
exit 1
fi
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Setup Prisma
run: pnpm prisma generate
- name: Run Reflexion Loop
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
REFLEXION_MAX_COST_USD: ${{ vars.REFLEXION_MAX_COST_USD || '3' }}
REFLEXION_MAX_REVISIONS: ${{ vars.REFLEXION_MAX_REVISIONS || '3' }}
run: node scripts/reflexion-issue-runner.js
- name: Upload State Artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: reflexion-state-${{ github.event.issue.number || github.event.inputs.issue_number }}
path: .reflexion-out/*
retention-days: 7
if-no-files-found: ignore