chore(deps): bump the framework group across 1 directory with 5 updates #8292
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: Bot Command Orchestrator | |
| on: | |
| issue_comment: | |
| types: [created] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.issue.number }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| issues: write | |
| checks: write | |
| actions: write | |
| jobs: | |
| router: | |
| name: 🔍 Route Comment | |
| runs-on: ubuntu-latest | |
| outputs: | |
| is_command_triggered: ${{ steps.route.outputs.is_command_triggered || 'false' }} | |
| is_review: ${{ steps.route.outputs.is_review || 'false' }} | |
| is_squash: ${{ steps.route.outputs.is_squash || 'false' }} | |
| is_resolve: ${{ steps.route.outputs.is_resolve || 'false' }} | |
| is_triage: ${{ steps.route.outputs.is_triage || 'false' }} | |
| is_coder: ${{ steps.route.outputs.is_coder || 'false' }} | |
| is_review_issues: ${{ steps.route.outputs.is_review_issues || 'false' }} | |
| is_enrich: ${{ steps.route.outputs.is_enrich || 'false' }} | |
| is_help: ${{ steps.route.outputs.is_help || 'false' }} | |
| steps: | |
| - id: route | |
| env: | |
| BODY: ${{ github.event.comment.body }} | |
| run: | | |
| # Use case-insensitive grep and ensure outputs are always set if matched. | |
| # We check for commands starting at the beginning of a line to avoid accidental triggers | |
| # from quotes or descriptive text mentioning the bots. | |
| if echo "$BODY" | grep -qiE "(^|\r?\n)@(gemini-bot|gemini-review)"; then echo "is_review=true" >> $GITHUB_OUTPUT; fi | |
| if echo "$BODY" | grep -qiE "(^|\r?\n)@pr-squash"; then echo "is_squash=true" >> $GITHUB_OUTPUT; fi | |
| if echo "$BODY" | grep -qiE "(^|\r?\n)@conflict-resolve"; then echo "is_resolve=true" >> $GITHUB_OUTPUT; fi | |
| if echo "$BODY" | grep -qiE "^@gemini-triage"; then echo "is_triage=true" >> $GITHUB_OUTPUT; fi | |
| if echo "$BODY" | grep -qiE "^@gemini-coder"; then echo "is_coder=true" >> $GITHUB_OUTPUT; fi | |
| if echo "$BODY" | grep -qiE "^@create-review-issues"; then echo "is_review_issues=true" >> $GITHUB_OUTPUT; fi | |
| if echo "$BODY" | grep -qiE "^@gemini-enrich"; then echo "is_enrich=true" >> $GITHUB_OUTPUT; fi | |
| if echo "$BODY" | grep -qiE "^@gemini-help"; then echo "is_help=true" >> $GITHUB_OUTPUT; fi | |
| # Set consolidated trigger flag for status jobs | |
| if echo "$BODY" | grep -qiE "(^|\r?\n)@(gemini-bot|gemini-review|pr-squash|conflict-resolve|gemini-triage|gemini-coder|create-review-issues|gemini-enrich|gemini-help)"; then | |
| echo "is_command_triggered=true" >> $GITHUB_OUTPUT | |
| fi | |
| init-status: | |
| needs: [router] | |
| if: needs.router.outputs.is_command_triggered == 'true' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| comment_id: ${{ steps.post-comment.outputs.comment-id }} | |
| steps: | |
| - name: Post Initial Status | |
| id: post-comment | |
| uses: peter-evans/create-or-update-comment@v4 | |
| with: | |
| issue-number: ${{ github.event.issue.number }} | |
| body: | | |
| ### 🤖 Command Operation Status | |
| ⏳ **Status:** In Progress... | |
| Triggered by: @${{ github.actor }} via [comment](${{ github.event.comment.html_url }}) | |
| <!-- id: comment-op-status-${{ github.event.comment.id }} --> | |
| execute-review: | |
| needs: [router] | |
| if: github.event.issue.pull_request && needs.router.outputs.is_review == 'true' | |
| uses: ./.github/workflows/reusable-gemini-review.yml | |
| with: | |
| pr_quality_result: 'not_applicable' | |
| trigger_event: 'comment' | |
| comment_body: ${{ github.event.comment.body }} | |
| pr_number: ${{ format('{0}', github.event.issue.number) }} | |
| secrets: inherit | |
| execute-triage: | |
| needs: [router] | |
| if: needs.router.outputs.is_triage == 'true' | |
| uses: ./.github/workflows/gemini-triage.yml | |
| with: | |
| issue_number: ${{ github.event.issue.number }} | |
| secrets: inherit | |
| execute-enrich: | |
| needs: [router] | |
| if: github.event.issue.pull_request && needs.router.outputs.is_enrich == 'true' | |
| uses: ./.github/workflows/pr-enrichment.yml | |
| with: | |
| pr_number: ${{ format('{0}', github.event.issue.number) }} | |
| manual_trigger: true | |
| secrets: inherit | |
| prepare-coder: | |
| needs: [router] | |
| if: needs.router.outputs.is_coder == 'true' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| task: ${{ steps.extract.outputs.task }} | |
| steps: | |
| - name: Extract Coder Task | |
| id: extract | |
| env: | |
| BODY: ${{ github.event.comment.body }} | |
| run: | | |
| # Remove '@gemini-coder' and any leading/trailing whitespace | |
| TASK=$(echo "$BODY" | sed 's/^@gemini-coder//I' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') | |
| if [ -z "$TASK" ]; then | |
| echo "::error::No task description provided for @gemini-coder" | |
| exit 1 | |
| fi | |
| echo "task=$TASK" >> $GITHUB_OUTPUT | |
| execute-coder: | |
| needs: [router, prepare-coder] | |
| if: needs.router.outputs.is_coder == 'true' | |
| uses: ./.github/workflows/gemini-coder.yml | |
| with: | |
| task_description: ${{ needs.prepare-coder.outputs.task }} | |
| branch_name: 'ai/comment-task-${{ github.event.issue.number }}-${{ github.run_id }}' | |
| secrets: inherit | |
| prepare-review-issues-manual: | |
| needs: [router] | |
| if: github.event.issue.pull_request && needs.router.outputs.is_review_issues == 'true' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| run_id: ${{ steps.find-run.outputs.run_id }} | |
| steps: | |
| - name: Find Latest Review Run | |
| id: find-run | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PR_NUMBER: ${{ github.event.issue.number }} | |
| run: | | |
| # Find the branch name of the PR | |
| BRANCH=$(gh pr view "$PR_NUMBER" --json headRefName -q .headRefName) | |
| # Find the most recent successful run of 'Gemini Orchestrator' (pr-orchestrator.yml) for this branch. | |
| # This workflow produces the 'review-result' artifact. | |
| RUN_ID=$(gh run list --workflow pr-orchestrator.yml --branch "$BRANCH" --status success --limit 1 --json databaseId -q '.[0].databaseId') | |
| # Fallback: check 'Bot Command Orchestrator' if manual review was triggered | |
| if [ -z "$RUN_ID" ]; then | |
| RUN_ID=$(gh run list --workflow "Bot Command Orchestrator" --branch "$BRANCH" --status success --limit 1 --json databaseId -q '.[0].databaseId') | |
| fi | |
| if [ -z "$RUN_ID" ]; then | |
| echo "::error::No successful Gemini Review run found for branch $BRANCH to source artifacts from." | |
| exit 1 | |
| fi | |
| echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT | |
| execute-create-review-issues: | |
| needs: [router, prepare-review-issues-manual] | |
| if: github.event.issue.pull_request && needs.router.outputs.is_review_issues == 'true' | |
| uses: ./.github/workflows/reusable-create-review-issues.yml | |
| with: | |
| trigger_event: 'comment' | |
| pr_number: ${{ format('{0}', github.event.issue.number) }} | |
| run_id: ${{ needs.prepare-review-issues-manual.outputs.run_id }} | |
| secrets: | |
| gh_token: ${{ secrets.GITHUB_TOKEN }} | |
| prepare-review-issues: | |
| name: 📝 Prepare Issue Context | |
| needs: [router, execute-review] | |
| if: | | |
| always() && | |
| needs.execute-review.result == 'success' && | |
| needs.execute-review.outputs.review_performed == 'true' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| base_sha: ${{ steps.get_pr.outputs.base_sha }} | |
| steps: | |
| - name: Get PR Base SHA | |
| id: get_pr | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const pr = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number, | |
| }); | |
| core.setOutput('base_sha', pr.data.base.sha); | |
| create-review-issues: | |
| name: 🚀 Create Review Issues | |
| needs: [execute-review, prepare-review-issues] | |
| if: | | |
| always() && | |
| needs.execute-review.result == 'success' && | |
| needs.execute-review.outputs.review_performed == 'true' | |
| uses: ./.github/workflows/reusable-create-review-issues.yml | |
| with: | |
| pr_number: ${{ github.event.issue.number }} | |
| base_sha: ${{ needs.prepare-review-issues.outputs.base_sha }} | |
| run_id: ${{ github.run_id }} | |
| secrets: | |
| gh_token: ${{ secrets.GITHUB_TOKEN }} | |
| execute-help: | |
| needs: [router] | |
| if: needs.router.outputs.is_help == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Post Help Comment | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const body = '### 🤖 Gemini Manual Trigger Reference\n\n' + | |
| 'You can trigger the following Gemini AI workflows via comments:\n\n' + | |
| '| Command | Action |\n' + | |
| '| :--- | :--- |\n' + | |
| '| `@gemini-bot` | Run AI Code Review (PR only) |\n' + | |
| '| `@gemini-enrich` | Run PR Enrichment (PR only) |\n' + | |
| '| `@gemini-triage` | Run Issue Triage |\n' + | |
| '| `@gemini-coder <task>` | Generate Code |\n' + | |
| '| `@create-review-issues` | Create issues from review (PR only) |\n' + | |
| '| `@jules-new` | Create Jules Session (PR only) |\n' + | |
| '| `@jules-delete` | Delete Jules Session (PR only) |\n' + | |
| '| `@gemini-help` | Show this help message |\n' + | |
| '| `@pr-squash` | Squash PR commits (PR only) |\n' + | |
| '| `@conflict-resolve` | Resolve merge conflicts (PR only) |\n\n' + | |
| 'For more details and GitHub CLI examples, see the [Manual Trigger Guide](' + context.payload.repository.html_url + '/blob/leader/docs/workflows/MANUAL_TRIGGERS.md).'; | |
| github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body: body | |
| }); | |
| execute-squash: | |
| needs: [router] | |
| if: github.event.issue.pull_request && needs.router.outputs.is_squash == 'true' | |
| uses: ./.github/workflows/pr-squash.yml | |
| with: | |
| pr_number: ${{ github.event.issue.number }} | |
| comment_body: ${{ github.event.comment.body }} | |
| comment_id: ${{ github.event.comment.id }} | |
| secrets: inherit | |
| # Restoring conflict resolution logic from gemini-orchestrator.yml | |
| prepare-resolve: | |
| needs: [router] | |
| if: github.event.issue.pull_request && needs.router.outputs.is_resolve == 'true' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| target_branch: ${{ steps.get_branches.outputs.target_branch }} | |
| source_branch: ${{ steps.get_branches.outputs.source_branch }} | |
| steps: | |
| - name: Add reaction to comment | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.reactions.createForIssueComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: context.payload.comment.id, | |
| content: 'eyes' | |
| }); | |
| - name: Get PR Details | |
| id: get_branches | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const pr = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number, | |
| }); | |
| core.setOutput('target_branch', pr.data.base.ref); | |
| core.setOutput('source_branch', pr.data.head.ref); | |
| execute-resolve: | |
| needs: [router, prepare-resolve] | |
| if: github.event.issue.pull_request && needs.router.outputs.is_resolve == 'true' | |
| uses: ./.github/workflows/conflict-resolver.yml | |
| with: | |
| target_branch: ${{ needs.prepare-resolve.outputs.target_branch }} | |
| source_branch: ${{ needs.prepare-resolve.outputs.source_branch }} | |
| pr_number: ${{ github.event.issue.number }} | |
| secrets: inherit | |
| finalize-status: | |
| needs: | |
| - router | |
| - init-status | |
| - execute-review | |
| - execute-triage | |
| - execute-coder | |
| - execute-create-review-issues | |
| - execute-help | |
| - execute-squash | |
| - execute-resolve | |
| if: always() && needs.init-status.result == 'success' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Determine Final Status | |
| id: status | |
| run: | | |
| REPORT="### 🤖 Command Operation Status\n\n" | |
| check_job() { | |
| local name=$1 | |
| local result=$2 | |
| local triggered=$3 | |
| if [ "$triggered" == "true" ]; then | |
| case $result in | |
| success) REPORT="${REPORT}✅ **$name:** Success\n" ;; | |
| failure) REPORT="${REPORT}❌ **$name:** Failed\n" ;; | |
| cancelled) REPORT="${REPORT}🚫 **$name:** Cancelled\n" ;; | |
| skipped) REPORT="${REPORT}⏭️ **$name:** Skipped\n" ;; | |
| *) REPORT="${REPORT}❓ **$name:** Unknown ($result)\n" ;; | |
| esac | |
| fi | |
| } | |
| check_job "Review" "${{ needs.execute-review.result }}" "${{ needs.router.outputs.is_review }}" | |
| check_job "Triage" "${{ needs.execute-triage.result }}" "${{ needs.router.outputs.is_triage }}" | |
| check_job "Coder" "${{ needs.execute-coder.result }}" "${{ needs.router.outputs.is_coder }}" | |
| check_job "Create Review Issues (Manual)" "${{ needs.execute-create-review-issues.result }}" "${{ needs.router.outputs.is_review_issues }}" | |
| check_job "Help" "${{ needs.execute-help.result }}" "${{ needs.router.outputs.is_help }}" | |
| check_job "Squash" "${{ needs.execute-squash.result }}" "${{ needs.router.outputs.is_squash }}" | |
| check_job "Resolve" "${{ needs.execute-resolve.result }}" "${{ needs.router.outputs.is_resolve }}" | |
| REPORT="${REPORT}\n---\nTriggered by: @${{ github.actor }} via [comment](${{ github.event.comment.html_url }})" | |
| REPORT="${REPORT}\n\n<!-- id: comment-op-status-${{ github.event.comment.id }} -->" | |
| echo "REPORT<<EOF" >> $GITHUB_OUTPUT | |
| printf "%b\n" "$REPORT" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Update Status Comment | |
| uses: peter-evans/create-or-update-comment@v4 | |
| with: | |
| comment-id: ${{ needs.init-status.outputs.comment_id }} | |
| body: ${{ steps.status.outputs.REPORT }} | |
| edit-mode: replace |