fix(ci): revert opencode-review to pull_request trigger
The OpenCode action doesn't support pull_request_target event. Revert to pull_request so it works for repo branch PRs. Fork PRs will be reviewed by claude-code-review.yml instead.
This commit is contained in:
parent
a024830127
commit
b4042da156
1 changed files with 5 additions and 7 deletions
12
.github/workflows/opencode-review.yml
vendored
12
.github/workflows/opencode-review.yml
vendored
|
|
@ -1,10 +1,10 @@
|
||||||
name: OpenCode PR Review
|
name: OpenCode PR Review
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Using pull_request_target to run with base repo permissions (access to secrets)
|
# Using pull_request (not pull_request_target) because the OpenCode action
|
||||||
# This allows the workflow to run for fork PRs after maintainer approval
|
# doesn't support pull_request_target. This means it only works for PRs from
|
||||||
# Security: This workflow only READS PR code for review, it does NOT execute it
|
# branches in this repo (not forks). Fork PRs are reviewed by claude-code-review.yml instead.
|
||||||
pull_request_target:
|
pull_request:
|
||||||
types: [opened, synchronize]
|
types: [opened, synchronize]
|
||||||
# Skip review for documentation and config-only changes
|
# Skip review for documentation and config-only changes
|
||||||
# Exclude this workflow file to prevent self-triggering loops
|
# Exclude this workflow file to prevent self-triggering loops
|
||||||
|
|
@ -38,15 +38,13 @@ jobs:
|
||||||
total=$((additions + deletions))
|
total=$((additions + deletions))
|
||||||
echo "total=$total" >> $GITHUB_OUTPUT
|
echo "total=$total" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Checkout PR code for review
|
- name: Checkout repository
|
||||||
# Only review substantial changes (5+ files OR 20+ lines changed)
|
# Only review substantial changes (5+ files OR 20+ lines changed)
|
||||||
if: |
|
if: |
|
||||||
github.event.pull_request.changed_files >= 5 ||
|
github.event.pull_request.changed_files >= 5 ||
|
||||||
steps.calc.outputs.total >= 20
|
steps.calc.outputs.total >= 20
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
# Checkout the PR head commit (pull_request_target defaults to base branch)
|
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue