Skip to content

Commit 4c8c3e9

Browse files
author
Paul Hewlett
committed
Fix branch protections
AB#8805
1 parent 87bc86a commit 4c8c3e9

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Verify Linked Task"
2+
3+
on: [pull_request]
4+
5+
# For details refer to https://github.com/tim-actions/commit-message-checker-with-regex
6+
jobs:
7+
check_pr:
8+
if: ${{ !startsWith(github.head_ref, 'dependabot') && !startsWith(github.head_ref, 'revert-') }}
9+
name: Check Commit Message
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Get PR Commits
13+
id: 'get-pr-commits'
14+
uses: tim-actions/get-pr-commits@master
15+
with:
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- name: Check Subject Line Length
19+
uses: tim-actions/[email protected]
20+
with:
21+
commits: ${{ steps.get-pr-commits.outputs.commits }}
22+
pattern: '^.{0,128}(\n.*)*$'
23+
error: 'Subject line too long (suggested 50 chars maximum 128)'
24+
25+
- name: Check Body Line Length
26+
if: ${{ success() || failure() }}
27+
uses: tim-actions/[email protected]
28+
with:
29+
commits: ${{ steps.get-pr-commits.outputs.commits }}
30+
pattern: '^.+(\n.{0,72})*$'
31+
error: 'Body line too long (max 72)'
32+
33+
- name: Check Azure ticket reference
34+
if: ${{ success() || failure() }}
35+
uses: tim-actions/[email protected]
36+
with:
37+
commits: ${{ steps.get-pr-commits.outputs.commits }}
38+
pattern: 'AB#\d{4,5}'
39+
error: 'No Azure ticket reference found'
40+
one_pass_all_pass: 'true'
41+

0 commit comments

Comments
 (0)