mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-20 19:24:43 +12:00
ci: Check pull request titles for the commit convention format (#10334)
ci: check pull request titles
This commit is contained in:
parent
757bed0b1f
commit
3cdddbe31d
1 changed files with 18 additions and 0 deletions
18
.github/workflows/pr-triage.yml
vendored
18
.github/workflows/pr-triage.yml
vendored
|
@ -1,6 +1,11 @@
|
||||||
name: 'PR Triage'
|
name: 'PR Triage'
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- edited
|
||||||
|
- reopened
|
||||||
|
- synchronize
|
||||||
jobs:
|
jobs:
|
||||||
pr-triage:
|
pr-triage:
|
||||||
name: PR Triage
|
name: PR Triage
|
||||||
|
@ -8,6 +13,19 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Automatically label PR
|
- name: Automatically label PR
|
||||||
uses: actions/labeler@v5
|
uses: actions/labeler@v5
|
||||||
|
if: github.event.action != 'edited'
|
||||||
with:
|
with:
|
||||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
sync-labels: true
|
sync-labels: true
|
||||||
|
|
||||||
|
- name: Validate commit convention
|
||||||
|
if: github.event.action != 'synchronize'
|
||||||
|
run: |
|
||||||
|
TITLE="${{ github.event.pull_request.title }}"
|
||||||
|
REGEX="^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\\(.+\\))?: .{1,72}$"
|
||||||
|
|
||||||
|
echo "Title: \"$TITLE\""
|
||||||
|
|
||||||
|
if [[ ! "$TITLE" =~ $REGEX ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue