forked from frankgrimes97/ZQL
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.39 KB
/
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
37
38
39
40
41
42
43
44
---
name: PR Checks
on: # yamllint disable-line rule:truthy
pull_request:
types: [opened, edited, synchronize, reopened]
env:
PR_TITLE_REGEX: '^\[(HOTFIX|[A-Z]+-[0-9]+)\]\s'
jobs:
title:
runs-on: ubuntu-latest
steps:
- uses: deepakputhraya/[email protected]
with:
regex: ${{ env.PR_TITLE_REGEX }}
- run: echo ${BODY}
- uses: actions/github-script@v5
if: ${{ failure() }}
with:
script: |
var regex=new RegExp(/${{env.PR_TITLE_REGEX}}/)
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `${{env.BODY}}`
})
env:
BODY: |
This PR title does not conform to [standards](https://adgear.atlassian.net/wiki/spaces/ENG/pages/19318375204/Pull+Request+Title).
Please update your PR title to match the following regex:
<pre>
${regex.source}
</pre>
which essentially boils down to prefixing with a Jira ticket number.
For instance, the following are all valid titles:
<pre>
[ENGNP-396] Fully support metadata JSON marshalling
[HOTFIX] Move cli package from internal to pkg
[ENGNP-120] Execute JQL off Jira
</pre>