Skip to content

Commit 1d2d86c

Browse files
Merge remote-tracking branch 'origin/main' into plot/ridgeline-basic
2 parents 26caf32 + eb1f7d0 commit 1d2d86c

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

.github/workflows/plot-review.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,20 @@ on:
1212
branches:
1313
- 'plot/**' # PRs targeting feature branches
1414

15+
# Manual trigger for reviewing specific PRs
16+
workflow_dispatch:
17+
inputs:
18+
pr_number:
19+
description: 'PR number to review'
20+
required: true
21+
type: string
22+
1523
jobs:
1624
ai-review:
17-
# Only run for auto/* branches (generated implementations)
18-
if: startsWith(github.event.pull_request.head.ref, 'auto/')
25+
# Run for auto/* branches OR manual workflow_dispatch
26+
if: >
27+
github.event_name == 'workflow_dispatch' ||
28+
startsWith(github.event.pull_request.head.ref, 'auto/')
1929
runs-on: ubuntu-latest
2030
permissions:
2131
contents: read
@@ -28,9 +38,27 @@ jobs:
2838
- name: Extract PR info
2939
id: get_pr
3040
env:
41+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
# For pull_request_target
3143
HEAD_REF: ${{ github.event.pull_request.head.ref }}
32-
PR_NUMBER: ${{ github.event.pull_request.number }}
44+
PR_NUMBER_EVENT: ${{ github.event.pull_request.number }}
45+
# For workflow_dispatch
46+
PR_NUMBER_INPUT: ${{ inputs.pr_number }}
3347
run: |
48+
# Determine PR number based on trigger type
49+
if [ -n "$PR_NUMBER_INPUT" ]; then
50+
# workflow_dispatch - lookup PR info
51+
PR_NUMBER="$PR_NUMBER_INPUT"
52+
PR_DATA=$(gh pr view "$PR_NUMBER" --json headRefName,headRefOid)
53+
HEAD_REF=$(echo "$PR_DATA" | jq -r '.headRefName')
54+
HEAD_SHA=$(echo "$PR_DATA" | jq -r '.headRefOid')
55+
echo "head_sha=$HEAD_SHA" >> $GITHUB_OUTPUT
56+
else
57+
# pull_request_target
58+
PR_NUMBER="$PR_NUMBER_EVENT"
59+
echo "head_sha=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
60+
fi
61+
3462
# Extract spec-id and library from branch name (auto/{spec-id}/{library})
3563
SPEC_ID=$(echo "$HEAD_REF" | cut -d'/' -f2)
3664
LIBRARY=$(echo "$HEAD_REF" | cut -d'/' -f3)
@@ -45,7 +73,7 @@ jobs:
4573
uses: actions/checkout@v6
4674
with:
4775
# Checkout PR head to review the actual implementation
48-
ref: ${{ github.event.pull_request.head.sha }}
76+
ref: ${{ steps.get_pr.outputs.head_sha }}
4977
fetch-depth: 0
5078

5179
- name: Get main issue number from PR

0 commit comments

Comments
 (0)