-
Notifications
You must be signed in to change notification settings - Fork 11
51 lines (45 loc) · 1.31 KB
/
check_pr_title.yml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Check PR title
on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize
- labeled
- unlabeled
pull_request:
paths:
- '.github/workflows/check_pr_title.yml'
jobs:
lint:
runs-on: ubuntu-latest
permissions:
statuses: write
steps:
- uses: aslafy-z/conventional-pr-title-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
spellcheck:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip check PR title') }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Install aspell
run: sudo apt-get install aspell
- name: Check PR title spelling
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
echo "$PR_TITLE"
if aspell --personal="./.github/project_dict.pws" list <<< "$PR_TITLE" | grep -q .; then
echo "Misspelled words found."
aspell --personal="./.github/project_dict.pws" list <<< "$PR_TITLE"
exit 1
else
echo "No misspelled words found."
exit 0
fi