-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (60 loc) · 2.18 KB
/
Copy pathconsensus-gate.yml
File metadata and controls
70 lines (60 loc) · 2.18 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
name: consensus-gate
on:
pull_request:
branches:
- "**"
workflow_dispatch:
jobs:
consensus-gate:
runs-on: ubuntu-latest
env:
# Gate policy (adjust as provider credentials are configured)
MIN_MODELS: "2"
ALLOW_STALE_DAYS: "365" # temporary high tolerance while wiring providers
SOFT_FAIL: "true" # set to false to hard-fail PRs when policy not met
STATE_PATH: AI_COORDINATION/orchestrator_state.json
# Provider secrets (optional for now, used when running active consensus in CI)
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Print provider secret presence (masked)
shell: bash
run: |
for key in OPENAI_API_KEY GOOGLE_API_KEY XAI_API_KEY OPENROUTER_API_KEY; do
if [ -n "${!key}" ]; then echo "$key=present"; else echo "$key=missing"; fi
done
# Optional: install dependencies if needed by local scripts
- name: Install Node dependencies (if present)
shell: bash
run: |
if [ -f package-lock.json ] || [ -f package.json ]; then
npm ci || npm install
fi
- name: Run consensus gate
shell: bash
run: |
node scripts/consensus_gate.js | tee consensus_gate_output.txt
- name: Upload gate artifacts
uses: actions/upload-artifact@v4
with:
name: consensus-gate-${{ github.run_id }}
path: |
consensus_gate_output.txt
${{ env.STATE_PATH }}
- name: Post PR summary
if: always()
shell: bash
run: |
echo "### Consensus Gate Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '\```json' >> $GITHUB_STEP_SUMMARY
cat consensus_gate_output.txt >> $GITHUB_STEP_SUMMARY
echo '\```' >> $GITHUB_STEP_SUMMARY