io pattern实现 #84
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
| name: Qoder Auto Code Review | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| qoder-review: | |
| # Skip fork and cross-repo PRs (head repo must match this repository) | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Run Qoder Code Review | |
| uses: QoderAI/qoder-action@v0 | |
| with: | |
| qoder_personal_access_token: ${{ secrets.QODER_PERSONAL_ACCESS_TOKEN }} | |
| prompt: | | |
| /review-pr | |
| REPO:${{ github.repository }} PR_NUMBER:${{ github.event.pull_request.number }} | |
| NO_AUTO_APPROVE: true | |
| When submitting the review via mcp__qoder_github__submit_pending_pull_request_review, you MUST use event type "COMMENT" only. The available event types are "APPROVE", "REQUEST_CHANGES", and "COMMENT". DO NOT use "APPROVE" or "REQUEST_CHANGES". Human maintainers must approve pull requests. | |
| - name: Dismiss accidental Qoder approval | |
| if: always() | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| set -euo pipefail | |
| PR_NUMBER="${{ github.event.pull_request.number }}" | |
| REPO="${{ github.repository }}" | |
| mapfile -t REVIEW_IDS < <( | |
| gh api "repos/${REPO}/pulls/${PR_NUMBER}/reviews" \ | |
| --jq '.[] | select(.user.login == "qoderai[bot]" and .state == "APPROVED") | .id' | |
| ) | |
| if [ "${#REVIEW_IDS[@]}" -eq 0 ]; then | |
| echo "No Qoder APPROVED reviews to dismiss." | |
| exit 0 | |
| fi | |
| for review_id in "${REVIEW_IDS[@]}"; do | |
| echo "Dismissing Qoder approval review ${review_id}..." | |
| gh api \ | |
| --method PUT \ | |
| "repos/${REPO}/pulls/${PR_NUMBER}/reviews/${review_id}/dismissals" \ | |
| -f message="Automated Qoder approvals are disabled; a human maintainer must approve this pull request." | |
| done |