Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 0 additions & 70 deletions .github/workflows/approve.yml

This file was deleted.

64 changes: 10 additions & 54 deletions .github/workflows/doc-minion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
required: true
type: string
dry_run:
description: "Dry run (prompt generation only)"
description: "Dry run"
required: false
default: false
type: boolean
Expand All @@ -23,67 +23,23 @@ jobs:
timeout-minutes: 15

steps:
# Checkout this repo (cli = principal)
- name: Checkout cli
uses: actions/checkout@v4
with:
path: cli

- name: Install yq
run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq

- name: Checkout project repos
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: |
for ENTRY in $(yq -r '.repos[] | .full_name + ":" + .name' cli/.minions/project.yaml); do
FULL="${ENTRY%%:*}"
SHORT="${ENTRY##*:}"
if [ "$SHORT" = "cli" ]; then
continue
fi
gh repo clone "$FULL" "$SHORT" -- --depth=1
done

- name: Configure git auth
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: git config --global url."https://x-access-token:${GH_TOKEN}@github.com/".insteadOf "https://github.com/"

- name: Checkout minions
uses: actions/checkout@v4
with:
repository: partio-io/minions
path: minions
token: ${{ secrets.GH_PAT }}

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.26"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Build minions
run: cd minions && make build
- uses: actions/checkout@v4

- name: Install Claude Code
run: npm install -g @anthropic-ai/claude-code

- name: Run doc minion
- name: Install minions
run: |
go install github.com/partio-io/minions/cmd/minions@latest
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"

- name: Run doc-update program
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GH_TOKEN: ${{ secrets.GH_PAT }}
WORKSPACE_ROOT: ${{ github.workspace }}
run: |
cd minions
ARGS="doc --pr ${{ inputs.pr_ref }}"
ARGS="run .minions/programs/doc-update.md"
if [ "${{ inputs.dry_run }}" = "true" ]; then
ARGS="${ARGS} --dry-run"
fi
./minions $ARGS
minions $ARGS
7 changes: 6 additions & 1 deletion .github/workflows/minion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ jobs:
echo "issue_num=${ISSUE_NUM}" >> "$GITHUB_OUTPUT"
fi

- name: Install Claude Code
run: npm install -g @anthropic-ai/claude-code

- name: Install minions
run: go install github.com/partio-io/minions/cmd/minions@latest
run: |
go install github.com/partio-io/minions/cmd/minions@latest
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"

- name: Run program
env:
Expand Down
126 changes: 24 additions & 102 deletions .github/workflows/plan.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
name: Plan Minion Task

on:
# Trigger when minion-planning label is added
issues:
types: [labeled]

# Trigger on /minion replan comment
issue_comment:
types: [created]

# Manual trigger
workflow_dispatch:
inputs:
issue_number:
description: "Issue number to plan for"
program:
description: "Program .md file path"
required: true
type: string

Expand All @@ -25,112 +18,41 @@ jobs:
plan:
if: >
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'issues' && github.event.label.name == 'minion-planning') ||
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '/minion replan'))
(github.event_name == 'issues' && github.event.label.name == 'minion-planning')
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Check authorization
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: |
ORG=$(echo "${{ github.repository }}" | cut -d'/' -f1)
ROLE=$(gh api "orgs/${ORG}/memberships/${{ github.actor }}" --jq '.role' 2>/dev/null || echo "none")
if [ "$ROLE" != "admin" ]; then
echo "::error::Unauthorized: ${{ github.actor }} (role: ${ROLE}) is not an org admin"
exit 1
fi

- name: Determine issue number
id: issue
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "number=${{ inputs.issue_number }}" >> "$GITHUB_OUTPUT"
else
echo "number=${{ github.event.issue.number }}" >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@v4

- name: Acknowledge replan request
if: github.event_name == 'issue_comment'
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: |
ISSUE_NUM="${{ steps.issue.outputs.number }}"
RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
gh issue comment "$ISSUE_NUM" --repo "${{ github.repository }}" \
--body "Minion re-planning triggered. [View workflow run](${RUN_URL})"

# Checkout this repo (cli = principal)
- name: Checkout cli
uses: actions/checkout@v4
with:
path: cli
- name: Install Claude Code
run: npm install -g @anthropic-ai/claude-code

- name: Install yq
- name: Install minions
run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
go install github.com/partio-io/minions/cmd/minions@latest
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"

- name: Checkout project repos
- name: Determine program
id: program
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: |
for ENTRY in $(yq -r '.repos[] | .full_name + ":" + .name' cli/.minions/project.yaml); do
FULL="${ENTRY%%:*}"
SHORT="${ENTRY##*:}"
if [ "$SHORT" = "cli" ]; then
continue
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "path=${{ inputs.program }}" >> "$GITHUB_OUTPUT"
else
ISSUE_NUM="${{ github.event.issue.number }}"
ISSUE_BODY=$(gh issue view "$ISSUE_NUM" --repo "${{ github.repository }}" --json body -q '.body')
PROGRAM_PATH=$(echo "$ISSUE_BODY" | grep -oP '(?<=<!-- program: ).*(?= -->)' || true)
if [ -z "$PROGRAM_PATH" ]; then
echo "::error::No program reference in issue #${ISSUE_NUM}"
exit 1
fi
gh repo clone "$FULL" "$SHORT" -- --depth=1
done

- name: Configure git auth
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: git config --global url."https://x-access-token:${GH_TOKEN}@github.com/".insteadOf "https://github.com/"

- name: Checkout minions
uses: actions/checkout@v4
with:
repository: partio-io/minions
path: minions
token: ${{ secrets.GH_PAT }}

# Install toolchains
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.26"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"

- name: Build minions
run: cd minions && make build

- name: Install Claude Code
run: npm install -g @anthropic-ai/claude-code
echo "path=${PROGRAM_PATH}" >> "$GITHUB_OUTPUT"
fi

# Run plan
- name: Generate plan
- name: Run program with planner
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GH_TOKEN: ${{ secrets.GH_PAT }}
WORKSPACE_ROOT: ${{ github.workspace }}
run: |
cd minions
./minions plan --issue ${{ steps.issue.outputs.number }} --repo "${{ github.repository }}"

# On failure: comment with logs link
- name: Report failure
if: failure()
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: |
ISSUE_NUM="${{ steps.issue.outputs.number }}"
RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
gh issue comment "$ISSUE_NUM" --repo "${{ github.repository }}" \
--body "Minion planning failed. [View logs](${RUN_URL})"
run: minions run ${{ steps.program.outputs.path }} --dry-run
Loading
Loading