Skip to content

Commit 5878e46

Browse files
authored
chore: add t-tooling label to new PRs as well (#1116)
Extends the new-issue labeling workflow to also run on PR open, adding the `t-tooling` label. Replicates apify/crawlee#4222. - Uses `pull_request_target` so the token can write labels on PRs from forks (nothing is checked out, so this is safe). - Adds `pull-requests: write` permission. `context.issue.number` already resolves to the PR number for PR events. [🤖] Claude Code using Opus 5.5
1 parent 6ab27de commit 5878e46

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎.github/workflows/on_issue.yaml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
name: CI (issue)
1+
name: CI (issue or PR)
22

33
on:
44
# Runs when a new issue is opened.
55
issues:
66
types:
77
- opened
8+
# Runs when a new PR is opened. pull_request_target so the token has write access for PRs from forks; no code is checked out here.
9+
pull_request_target:
10+
types:
11+
- opened
812

913
permissions:
1014
contents: read
@@ -15,9 +19,10 @@ jobs:
1519
runs-on: ubuntu-latest
1620
permissions:
1721
issues: write
22+
pull-requests: write
1823

1924
steps:
20-
# Add the "t-tooling" label to all new issues
25+
# Add the "t-tooling" label to all new issues and PRs
2126
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
2227
with:
2328
script: |

0 commit comments

Comments
 (0)