generated from NHSDigital/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (34 loc) · 1.49 KB
/
pull_request.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
name: deploy_pr
on:
pull_request:
branches: [main]
jobs:
quality_checks:
uses: ./.github/workflows/quality_checks.yml
with:
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
pr_title_format_check:
runs-on: ubuntu-latest
steps:
- name: Check PR Title is Prefixed with Change Type
run: |
if [[ "${{ github.event.pull_request.title }}" =~ ^(Fix|Update|New|Breaking|Docs|Build|Upgrade|Chore):.*$ ]]; then
echo "PR title is prefixed with change type."
else
echo "PR title is not prefixed with change type."
echo "Please prefix your PR title with a change type (Fix, Update, New, Breaking, Docs, Build, Upgrade, Chore)."
echo "See the ESLint commit convention for more details:"
echo "https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint"
exit 1
fi
- name: Check PR Title contains Ticket/Dependabot Reference
run: |
if [[ "${{ github.event.pull_request.title }}" =~ ^.*:.*\[(AEA-\d{4}|dependabot)\].*\-.*$ ]]; then
echo "PR title contains ticket or dependabot reference."
else
echo "PR title does not contain ticket or dependabot reference."
echo "Please ensure PR title contains a ticket (eg. 'Fix: [AEA-####] - ...', or 'Chore: [dependabot] - ...')."
exit 1
fi