Add partio attach command to manually link untracked sessions to commits
#60
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Minion | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| program: | |
| description: "Program .md file path (e.g., .minions/programs/detect-hooks.md)" | |
| required: true | |
| type: string | |
| dry_run: | |
| description: "Dry run (prompt generation only)" | |
| required: false | |
| default: false | |
| type: boolean | |
| issues: | |
| types: [labeled] | |
| issue_comment: | |
| types: [created] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| issues: write | |
| jobs: | |
| run-minion: | |
| if: > | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event_name == 'issues' && (github.event.label.name == 'minion-ready' || github.event.label.name == 'minion-approved')) || | |
| (github.event_name == 'issue_comment' && contains(github.event.comment.body, '/minion build')) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Determine program | |
| id: program | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_PAT }} | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "path=${{ inputs.program }}" >> "$GITHUB_OUTPUT" | |
| echo "dry_run=${{ inputs.dry_run }}" >> "$GITHUB_OUTPUT" | |
| echo "issue_num=" >> "$GITHUB_OUTPUT" | |
| else | |
| ISSUE_NUM="${{ github.event.issue.number }}" | |
| echo "path=.minions/programs/implement.md" >> "$GITHUB_OUTPUT" | |
| echo "dry_run=false" >> "$GITHUB_OUTPUT" | |
| 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@v0.0.3 | |
| echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" | |
| - name: Run program | |
| env: | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| GH_TOKEN: ${{ secrets.GH_PAT }} | |
| run: | | |
| ARGS="run ${{ steps.program.outputs.path }}" | |
| if [ -n "${{ steps.program.outputs.issue_num }}" ]; then | |
| ARGS="${ARGS} --issue ${{ steps.program.outputs.issue_num }}" | |
| fi | |
| if [ "${{ steps.program.outputs.dry_run }}" = "true" ]; then | |
| ARGS="${ARGS} --dry-run" | |
| fi | |
| minions $ARGS | |
| - name: Mark done | |
| if: success() && steps.program.outputs.issue_num != '' | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_PAT }} | |
| run: | | |
| ISSUE_NUM="${{ steps.program.outputs.issue_num }}" | |
| gh issue edit "$ISSUE_NUM" --repo "${{ github.repository }}" \ | |
| --add-label "minion-done" --remove-label "minion-executing" | |
| gh issue close "$ISSUE_NUM" --repo "${{ github.repository }}" \ | |
| --comment "Minion completed successfully." | |
| - name: Mark failed | |
| if: failure() && steps.program.outputs.issue_num != '' | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_PAT }} | |
| run: | | |
| ISSUE_NUM="${{ steps.program.outputs.issue_num }}" | |
| RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| gh issue edit "$ISSUE_NUM" --repo "${{ github.repository }}" \ | |
| --add-label "minion-failed" --remove-label "minion-executing" | |
| gh issue comment "$ISSUE_NUM" --repo "${{ github.repository }}" \ | |
| --body "Minion execution failed. [View logs](${RUN_URL})" |