feat: Add Constellos review workflow #10
Workflow file for this run
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
| # Constellos Review Workflow | |
| # Runs AI-powered code reviews on PRs using Claude | |
| name: Constellos Review | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| issues: read | |
| pull-requests: write | |
| jobs: | |
| # Read config and determine which agents to run | |
| config: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| agents: ${{ steps.read.outputs.agents }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: read | |
| run: | | |
| if [ -f ".constellos/config.json" ]; then | |
| AGENTS=$(jq -c '[.agents | to_entries[] | select(.value.enabled) | .key]' .constellos/config.json) | |
| else | |
| # Default: run both agents | |
| AGENTS='["requirements","code-quality"]' | |
| fi | |
| echo "agents=$AGENTS" >> $GITHUB_OUTPUT | |
| # Run each enabled agent in parallel | |
| review: | |
| needs: config | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| agent: ${{ fromJson(needs.config.outputs.agents) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Requirements reviewer | |
| - name: Run requirements review | |
| id: requirements | |
| if: matrix.agent == 'requirements' | |
| uses: ./.github/actions/requirements-reviewer | |
| with: | |
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | |
| pr_number: ${{ github.event.number }} | |
| branch: ${{ github.head_ref }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Post requirements comment | |
| if: matrix.agent == 'requirements' | |
| uses: ./.github/actions/review-comment | |
| with: | |
| review_name: Requirements | |
| passed: ${{ steps.requirements.outputs.passed }} | |
| result_json: ${{ steps.requirements.outputs.result }} | |
| checks_passed: ${{ steps.requirements.outputs.checks_passed }} | |
| checks_failed: ${{ steps.requirements.outputs.checks_failed }} | |
| checks_skipped: ${{ steps.requirements.outputs.checks_skipped }} | |
| pr_number: ${{ github.event.number }} | |
| sha: ${{ github.event.pull_request.head.sha }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| prompt_file: .constellos/agents/requirements.md | |
| # Code quality reviewer | |
| - name: Run code-quality review | |
| id: code-quality | |
| if: matrix.agent == 'code-quality' | |
| uses: ./.github/actions/code-quality-reviewer | |
| with: | |
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | |
| pr_number: ${{ github.event.number }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Post code-quality comment | |
| if: matrix.agent == 'code-quality' | |
| uses: ./.github/actions/review-comment | |
| with: | |
| review_name: Code Quality | |
| passed: ${{ steps.code-quality.outputs.passed }} | |
| result_json: ${{ steps.code-quality.outputs.result }} | |
| checks_passed: ${{ steps.code-quality.outputs.checks_passed }} | |
| checks_failed: ${{ steps.code-quality.outputs.checks_failed }} | |
| checks_skipped: ${{ steps.code-quality.outputs.checks_skipped }} | |
| pr_number: ${{ github.event.number }} | |
| sha: ${{ github.event.pull_request.head.sha }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| prompt_file: .constellos/agents/code-quality.md |