-
-
Notifications
You must be signed in to change notification settings - Fork 9
36 lines (30 loc) · 952 Bytes
/
pr-checks.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
name: Pull Request Checks
on:
pull_request:
types:
- opened
- edited
- reopened
defaults:
run:
shell: bash
jobs:
check-pr-message:
runs-on: ubuntu-latest
steps:
- name: Check the PR title and description
run: |
errors=
if grep -qE '^.{73,}$' <<< "${{ github.event.pull_request.title }}"; then
printf "ERROR: The PR title is longer than 72 characters:\n"
printf " > ${{ github.event.pull_request.title }}\n"
errors=true
fi
issue_regex='(Resolves|Fixes):? +(https:\/\/github.com\/)?AlmaLinux\/build-system(\/issues\/|#)[0-9]+'
if ! grep -qE "$issue_regex" <<< "${{ github.event.pull_request.body }}"; then
printf "ERROR: You need at least one \"Resolves|Fixes: <issue link>\" line.\n"
errors=true
fi
if [[ $errors == true ]]; then
exit 2
fi