Need Some Urgent Fetures, #263
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: Kimi Code Review | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| issues: | |
| types: [opened, reopened] | |
| issue_comment: | |
| types: [created] | |
| pull_request_review_comment: | |
| types: [created] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| jobs: | |
| pr-review: | |
| runs-on: ubuntu-latest | |
| if: | | |
| github.event_name == 'pull_request' || | |
| (github.event_name == 'issue_comment' && | |
| github.event.issue.pull_request && | |
| startsWith(github.event.comment.body, '/')) || | |
| (github.event_name == 'pull_request_review_comment' && | |
| startsWith(github.event.comment.body, '/')) | |
| steps: | |
| - name: Get PR ref (for comments) | |
| id: get-pr | |
| if: github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const prNumber = context.issue?.number || context.payload.pull_request?.number; | |
| const pr = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: prNumber | |
| }); | |
| core.setOutput('ref', pr.data.head.ref); | |
| core.setOutput('sha', pr.data.head.sha); | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ (github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment') && steps.get-pr.outputs.ref || github.head_ref }} | |
| - uses: xiaoju111a/kimi-actions@main | |
| with: | |
| kimi_api_key: ${{ secrets.KIMI_API_KEY }} | |
| kimi_base_url: ${{ secrets.KIMI_BASE_URL }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| auto_review: 'false' | |
| issue-triage: | |
| runs-on: ubuntu-latest | |
| if: | | |
| github.event_name == 'issues' || | |
| (github.event_name == 'issue_comment' && | |
| !github.event.issue.pull_request && | |
| startsWith(github.event.comment.body, '/')) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: xiaoju111a/kimi-actions@main | |
| with: | |
| kimi_api_key: ${{ secrets.KIMI_API_KEY }} | |
| kimi_base_url: ${{ secrets.KIMI_BASE_URL }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| auto_triage: 'false' |