-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.37 KB
/
verify-azure-issue.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
name: "Verify Linked Task"
on: [pull_request]
# For details refer to https://github.com/tim-actions/commit-message-checker-with-regex
jobs:
check-pr:
if: ${{ !startsWith(github.head_ref, 'dependabot') }}
name: Check Commit Message
runs-on: ubuntu-latest
steps:
- name: Get PR Commits
id: 'get-pr-commits'
uses: tim-actions/get-pr-commits@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check Subject Line Length
uses: tim-actions/[email protected]
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
pattern: '^.{0,128}(\n.*)*$'
error: 'Subject too long - recommended 50 (max 128)'
- name: Check Body Line Length
if: ${{ success() || failure() }}
uses: tim-actions/[email protected]
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
pattern: '^.+(\n.{0,72})*$'
error: 'Body line too long (max 72)'
- name: Check Azure ticket reference
if: ${{ success() || failure() }}
uses: tim-actions/[email protected]
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
pattern: 'AB#\d{4,5}'
error: 'No Azure ticket reference found'
one_pass_all_pass: 'true'