Skip to content

Commit 50876b0

Browse files
committed
Fix workflow
1 parent 0bbe115 commit 50876b0

File tree

2 files changed

+52
-8
lines changed

2 files changed

+52
-8
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "Claude React On Review Dispatch"
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Claude React On Review"]
6+
types: [completed]
7+
8+
jobs:
9+
dispatch:
10+
runs-on: ubuntu-latest
11+
if: github.event.workflow_run.conclusion == 'success'
12+
permissions:
13+
contents: read
14+
actions: write
15+
steps:
16+
- name: Harden the runner (Audit all outbound calls)
17+
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
18+
with:
19+
egress-policy: audit
20+
21+
- name: Download review context
22+
id: download
23+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
24+
continue-on-error: true
25+
with:
26+
name: review-context
27+
run-id: ${{ github.event.workflow_run.id }}
28+
github-token: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Trigger Claude PR Review
31+
if: steps.download.outcome == 'success'
32+
env:
33+
GH_TOKEN: ${{ secrets.PHPSTAN_BOT_TOKEN }}
34+
run: |
35+
pr_number=$(cat pr_number.txt)
36+
review_id=$(cat review_id.txt)
37+
gh workflow run claude-pr-review.yml \
38+
-f pr_number="$pr_number" \
39+
-f review_id="$review_id" \
40+
--repo phpstan-bot/phpstan-src

.github/workflows/claude-react-on-review.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@ on:
55
types: [submitted]
66

77
jobs:
8-
claude:
8+
save-context:
99
runs-on: ubuntu-latest
10-
permissions:
11-
contents: read
12-
actions: write
1310
if: github.event.pull_request.user.login == 'phpstan-bot'
1411
steps:
1512
- name: Harden the runner (Audit all outbound calls)
1613
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
1714
with:
1815
egress-policy: audit
1916

20-
- name: Trigger Claude Review PR
21-
env:
22-
GH_TOKEN: ${{ github.token }}
23-
run: gh workflow run claude-pr-review.yml -f pr_number=${{ github.event.pull_request.number }} -f review_id=${{ github.event.review.id }} --repo phpstan-bot/phpstan-src
17+
- name: Save review context
18+
run: |
19+
echo "${{ github.event.pull_request.number }}" > pr_number.txt
20+
echo "${{ github.event.review.id }}" > review_id.txt
21+
22+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
23+
with:
24+
name: review-context
25+
path: |
26+
pr_number.txt
27+
review_id.txt

0 commit comments

Comments
 (0)