-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 914 Bytes
/
pr-triage.yml
File metadata and controls
38 lines (36 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: "PR Triage"
on:
pull_request_target:
types:
- opened
- edited
- reopened
- synchronize
jobs:
label:
permissions:
contents: read
pull-requests: write
issues: write
name: Label
if: github.event.action != 'edited'
runs-on: ubuntu-latest
steps:
- name: Label pull request
uses: actions/labeler@v6
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
validate-title:
name: Validate title
runs-on: ubuntu-latest
steps:
- name: Validate pull request title
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
REGEX="^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore|types)(\\(.+\\))?!?: .{1,72}$"
echo "Title: \"$TITLE\""
if [[ ! "$TITLE" =~ $REGEX ]]; then
exit 1
fi