Skip to content

Commit af26601

Browse files
chore: add an ection that ensures the PR title is valid (louislam#6653)
1 parent 27c0ae8 commit af26601

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/pr-title.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "PR Metadata"
2+
# if someone opens a PR, edits it, or reopens it we want to validate the title
3+
# This is separate from the rest of the CI as the title may change without code changes
4+
5+
on:
6+
# SECURITY: pull_request_target is used here to allow validation of PRs from forks.
7+
# This is safe because:
8+
# 1. No code from the PR is checked out
9+
# 2. Permissions are restricted to pull-requests: read
10+
# 3. Only a trusted third-party action is used to validate the PR title
11+
# 4. No user-controlled code is executed
12+
pull_request_target: # zizmor: ignore[dangerous-triggers]
13+
types:
14+
- opened
15+
- edited
16+
- reopened
17+
- synchronize
18+
19+
permissions:
20+
pull-requests: read
21+
22+
jobs:
23+
pr-title:
24+
name: Validate PR title follows https://conventionalcommits.org
25+
runs-on: ubuntu-latest
26+
permissions:
27+
pull-requests: read
28+
steps:
29+
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)