fix: 修正workflow文件

This commit is contained in:
ElyPrism 2026-08-02 16:19:40 +08:00
parent 9608da9b96
commit a79a2d9ef6
No known key found for this signature in database
2 changed files with 46 additions and 2 deletions

View File

@ -5,8 +5,6 @@ on:
types: [created] types: [created]
pull_request_review_comment: pull_request_review_comment:
types: [created] types: [created]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
issues: issues:
types: [opened] types: [opened]

46
.github/workflows/pr-reviewer.yml vendored Normal file
View File

@ -0,0 +1,46 @@
name: opencode-review
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: read
jobs:
review:
# 跳过 fork 来的 PRGitHub 不会把 secrets 传给 fork PR 触发的工作流,
# 跑了也必然失败,所以直接跳过避免噪音(平台限制,非配置问题)。
if: github.event.pull_request.head.repo.fork == false
runs-on: ubuntu-latest
steps:
- name: Generate bot token
id: token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
token: ${{ steps.token.outputs.token }}
- name: Configure git identity
run: |
git config --global user.name "takanashi-hoshino-agent[bot]"
git config --global user.email "takanashi-hoshino-agent[bot]@users.noreply.github.com"
- name: Run opencode review
uses: anomalyco/opencode/github@latest
env:
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
# 用自定义 GitHub App 生成的 bot token跟原 opencode.yml 一致,
# 评论 PR / 提交都走 takanashi-hoshino-agent[bot] 的身份。
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
with:
model: opencode/deepseek-v4-flash-free
use_github_token: true
prompt: ${{ secrets.OPENCODE_PROMPT }}