Skip to content

Commit 3cc954b

Browse files
nevoodooclaude
andcommitted
Document pull_request trigger requirement for PR comments
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1000b34 commit 3cc954b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,22 @@ permissions:
134134
pull-requests: write
135135
```
136136

137+
The `comment-on-pr` feature requires the workflow to trigger on `pull_request`
138+
events. The PR number is read from `github.event.pull_request.number`, which
139+
is only available on `pull_request` triggers — not `push`.
140+
141+
A common pattern for running on both PRs and main:
142+
143+
```yaml
144+
on:
145+
push:
146+
branches: [main]
147+
pull_request:
148+
```
149+
150+
This avoids double runs — `push` fires only for `main`, `pull_request` fires
151+
for PRs.
152+
137153
## Local usage
138154

139155
```bash

0 commit comments

Comments
 (0)