Skip to content

Commit 50012d9

Browse files
authored
chore: update pull_request_target types, harden (#33096)
Enhance the pull request workflows by updating the `pull_request_target` types and ensuring safety by avoiding checkout of the PR's head. Update the action to use a specific commit from the archived repository.
1 parent 33f0687 commit 50012d9

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/workflows/pr_labeler_file.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
name: "🏷️ Pull Request Labeler"
66

77
on:
8+
# Safe since we're not checking out or running the PR's code
9+
# Never check out the PR's head in a pull_request_target job
810
pull_request_target:
9-
types: [opened, synchronize, reopened]
11+
types: [opened, synchronize, reopened, edited]
1012

1113
jobs:
1214
labeler:

.github/workflows/pr_labeler_title.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
name: "🏷️ PR Title Labeler"
66

77
on:
8-
pull_request:
8+
# Safe since we're not checking out or running the PR's code
9+
# Never check out the PR's head in a pull_request_target job
10+
pull_request_target:
911
types: [opened, synchronize, reopened, edited]
1012

1113
jobs:
@@ -19,7 +21,8 @@ jobs:
1921

2022
steps:
2123
- name: Label PR based on title
22-
uses: grafana/[email protected]
24+
# Archived repo; latest commit (v0.1.0)
25+
uses: grafana/pr-labeler-action@f19222d3ef883d2ca5f04420fdfe8148003763f0
2326
with:
2427
token: ${{ secrets.GITHUB_TOKEN }}
2528
configuration-path: .github/pr-title-labeler.yml

0 commit comments

Comments
 (0)