Chore Bot Automation #110
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: Chore Bot Automation | |
| on: | |
| schedule: | |
| # Run every 6 hours | |
| - cron: '0 */6 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| repo: | |
| description: 'Repository to run on' | |
| required: true | |
| default: 'syster' | |
| type: choice | |
| options: | |
| - syster | |
| - mother | |
| - all | |
| command: | |
| description: 'Command to run' | |
| required: true | |
| default: 'nudge' | |
| type: choice | |
| options: | |
| - nudge | |
| - conflicts | |
| - conflicts-close | |
| - approve | |
| - test | |
| - feature | |
| - all | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| run-chore-bot: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| repo: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.repo != 'all' && fromJSON(format('["{0}"]', github.event.inputs.repo)) || fromJSON('["syster", "mother"]') }} | |
| steps: | |
| - name: Checkout chore-bot | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build chore-bot | |
| run: cargo build --release | |
| - name: Authenticate GitHub CLI | |
| run: echo "${{ secrets.GH_PAT }}" | gh auth login --with-token | |
| - name: Clone target repo | |
| run: gh repo clone jade-codes/${{ matrix.repo }} repos/${{ matrix.repo }} | |
| - name: Approve pending workflows | |
| if: github.event_name == 'schedule' || github.event.inputs.command == 'approve' || github.event.inputs.command == 'all' | |
| run: ./target/release/chore-bot approve --repo-path repos/${{ matrix.repo }} | |
| continue-on-error: true | |
| - name: Nudge failing PRs | |
| if: github.event_name == 'schedule' || github.event.inputs.command == 'nudge' || github.event.inputs.command == 'all' | |
| run: ./target/release/chore-bot nudge --repo-path repos/${{ matrix.repo }} | |
| continue-on-error: true | |
| - name: Handle merge conflicts (comment) | |
| if: github.event.inputs.command == 'conflicts' | |
| run: ./target/release/chore-bot conflicts --repo-path repos/${{ matrix.repo }} | |
| continue-on-error: true | |
| - name: Handle merge conflicts (close and respawn) | |
| if: github.event_name == 'schedule' || github.event.inputs.command == 'conflicts-close' || github.event.inputs.command == 'all' | |
| run: ./target/release/chore-bot conflicts --repo-path repos/${{ matrix.repo }} --close | |
| continue-on-error: true | |
| - name: Spawn test agents | |
| if: github.event_name == 'schedule' || github.event.inputs.command == 'test' || github.event.inputs.command == 'all' | |
| run: ./target/release/chore-bot test --repo-path repos/${{ matrix.repo }} --max-prs 3 | |
| continue-on-error: true | |
| - name: Spawn feature agents | |
| if: github.event.inputs.command == 'feature' | |
| run: ./target/release/chore-bot feature --repo-path repos/${{ matrix.repo }} --max-prs 3 | |
| continue-on-error: true |