-
Notifications
You must be signed in to change notification settings - Fork 0
27 lines (25 loc) · 1.23 KB
/
pr-lint.yaml
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
name: PR Quality Check
on: pull_request
jobs:
link-ticket:
runs-on: ubuntu-latest
steps:
- name: Check ticket name conforms to requirements
run: echo ${{ github.event.pull_request.head.ref }} | grep -i -E -q "(npa-[0-9]+)|(dependabot\/)"
continue-on-error: true
- name: Grab ticket name
if: contains(github.event.pull_request.head.ref, 'npa-') || contains(github.event.pull_request.head.ref, 'NPA-')
run: echo ::set-env name=TICKET_NAME::$(echo ${{ github.event.pull_request.head.ref }} | grep -i -o '\(npa-[0-9]\+\)' | tr '[:lower:]' '[:upper:]')
continue-on-error: true
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Comment on PR with link to JIRA ticket
if: contains(github.event.pull_request.head.ref, 'npa-') || contains(github.event.pull_request.head.ref, 'NPA-')
continue-on-error: true
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: |
This branch is work on a ticket in the NHS Digital NPA JIRA Project. Here's a handy link to the ticket:
# [${{ env.TICKET_NAME }}](https://nhsd-jira.digital.nhs.uk/browse/${{ env.TICKET_NAME}})