Skip to content

Commit 815fea0

Browse files
committed
[build] make proper use of pull_request_target for auto labeling and commenting
1 parent 38234bd commit 815fea0

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/label-commenter.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Label Commenter
44
on:
55
issues:
66
types: [ labeled ]
7-
pull_request:
7+
pull_request_target:
88
types: [labeled]
99

1010
permissions:
@@ -16,11 +16,15 @@ jobs:
1616
if: github.repository_owner == 'seleniumhq'
1717
runs-on: ubuntu-latest
1818
steps:
19-
- name: Checkout repo to get config file
19+
- name: Checkout base repo to get config file
2020
uses: actions/checkout@v4
21+
with:
22+
ref: ${{ github.event.pull_request.base.ref }}
23+
repository: seleniumhq/selenium
2124
- name: Label Commenter
2225
uses: peaceiris/actions-label-commenter@v1
2326
with:
2427
# The individual PAT is needed so commenter can auto-executes on PRs from Forks
2528
# It expires 4/1/2026
2629
github_token: ${{ secrets.LABEL_COMMENTER_PAT }}
30+
config_file: .github/label-commenter-config.yml

.github/workflows/pr-labeler.yml

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ jobs:
1313
label:
1414
runs-on: ubuntu-latest
1515
steps:
16+
- name: Checkout base repo to get config file
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.pull_request.base.ref }}
20+
repository: seleniumhq/selenium
1621
- name: Auto label Pull Requests
1722
uses: actions/labeler@v5
1823
with:

0 commit comments

Comments
 (0)