Skip to content

Commit 0560433

Browse files
authored
chore(repo): limit pr validation runs to checkout only from master (#32545)
Reduces some unnecessary permissions to ease future risks.
1 parent f929324 commit 0560433

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/pr-title-validation.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: PR Title Validation
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
types: [opened, edited, synchronize, reopened]
66

7+
permissions: read-all
8+
79
jobs:
810
validate-pr-title:
911
name: Validate PR Title
@@ -12,8 +14,8 @@ jobs:
1214
- name: Checkout code
1315
uses: actions/checkout@v4
1416
with:
15-
# For pull_request_target, we need to checkout the base branch
16-
ref: ${{ github.event.pull_request.base.ref }}
17+
# Ensure's validate-pr-title.js is the copy from master
18+
ref: master
1719

1820
- name: Setup Node.js
1921
uses: actions/setup-node@v4

0 commit comments

Comments
 (0)