-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathaction.yml
More file actions
109 lines (98 loc) · 3.35 KB
/
action.yml
File metadata and controls
109 lines (98 loc) · 3.35 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
97
98
99
100
101
102
103
104
105
106
107
108
109
name: "Bernstein — Multi-Agent Orchestration"
description: "Run Bernstein to orchestrate CLI coding agents from GitHub Actions. Supports ad-hoc tasks and automatic CI-fix mode."
author: "Bernstein contributors"
branding:
icon: "cpu"
color: "gray-dark"
inputs:
task:
description: >
Task description for Bernstein, or the literal string "fix-ci" to
automatically download failed job logs and attempt a fix.
Mutually exclusive with `plan`.
required: false
default: ""
plan:
description: >
Path to a Bernstein plan YAML file (e.g. `plans/my-project.yaml`).
When set, Bernstein runs the plan with `bernstein run <plan>` instead of
a free-text goal. Mutually exclusive with `task`.
required: false
default: ""
budget:
description: "Dollar cap for the run (0 = unlimited)."
required: false
default: "5.00"
cli:
description: "Which agent CLI to use (claude, codex, gemini, qwen)."
required: false
default: "claude"
max-retries:
description: "Number of retry attempts in fix-ci mode."
required: false
default: "3"
python-version:
description: "Python version to install."
required: false
default: "3.12"
post-comment:
description: "Post a PR comment with orchestration summary after the run (true/false)."
required: false
default: "true"
outputs:
tasks-completed:
description: "Number of tasks Bernstein completed in this run."
value: ${{ steps.run-bernstein.outputs.tasks_completed }}
total-cost:
description: "Total API cost in USD for this run."
value: ${{ steps.run-bernstein.outputs.total_cost }}
pr-url:
description: "URL of a pull request created or updated by Bernstein (if any)."
value: ${{ steps.run-bernstein.outputs.pr_url }}
evidence-bundle-path:
description: "Workspace-relative path to the evidence bundle (test results, logs, cost report)."
value: ${{ steps.run-bernstein.outputs.evidence_bundle_path }}
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install Bernstein
shell: bash
run: uv tool install bernstein
- name: Run Bernstein
id: run-bernstein
shell: bash
env:
INPUT_TASK: ${{ inputs.task }}
INPUT_PLAN: ${{ inputs.plan }}
INPUT_BUDGET: ${{ inputs.budget }}
INPUT_CLI: ${{ inputs.cli }}
INPUT_MAX_RETRIES: ${{ inputs.max-retries }}
INPUT_POST_COMMENT: ${{ inputs.post-comment }}
GITHUB_TOKEN: ${{ github.token }}
run: bash "${{ github.action_path }}/action/entrypoint.sh"
- name: Commit and push results
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to commit."
exit 0
fi
git config user.name "bernstein[bot]"
git config user.email "[email protected]"
git add -A
git commit -m "fix: apply bernstein auto-fix
Triggered by GitHub Action run.
Task: ${INPUT_TASK:-unknown}"
# Push to the current branch
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
git push origin "HEAD:${BRANCH}"