-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (41 loc) · 2.03 KB
/
pr-lint.yaml
File metadata and controls
47 lines (41 loc) · 2.03 KB
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
45
46
47
name: PR Quality Check
run-name: PR Quality Check for ${{ github.event.pull_request.head.ref }} opened by @${{ github.actor }}
on: [pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Set TICKET_NAME environment variable if branch name references a Jira ticket
env:
REF: ${{ github.event.pull_request.head.ref }}
run: |
OUTPUT=$(echo "$REF" | { grep -i -E -q "(apm-[0-9]+)|(apmspii-[0-9]+)|(adz-[0-9]+)|(amb-[0-9]+)|(amp-[0-9]+)|(dependabot\/)" || test $? = 1; })
if [ ! -z "$OUTPUT" -a "$OUTPUT" != " " ]; then
TICKET_NAME=$(echo $OUTPUT | tr '[:lower:]' '[:upper:]')
echo "TICKET_NAME=$TICKET_NAME" >> "$GITHUB_ENV"
fi
- name: Comment on PR with link to JIRA ticket
uses: thollander/actions-comment-pull-request@v2
if: ${{ env.TICKET_NAME }}
with:
message: |
This branch is work on a ticket in the NHS England's API Management JIRA Project:
# [${{ env.TICKET_NAME }}](https://nhsd-jira.digital.nhs.uk/browse/${{ env.TICKET_NAME}})
comment_tag: jira-ticket
- name: Add UAT Portal Deployment Instructions to PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Manually run the [Publish Spec to Bloomreach UAT Portal](https://github.com/NHSDigital/proxygen-api-specification/actions/workflows/publish-uat.yml) to preview specification on the [UAT Portal](https://uat2.nhsd.io/developer/api-catalogue/proxy-generator) (requires VPN).
comment_tag: uat-deploy
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Cache node modules
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.npm
key: ${{ runner.os }}-build-cache-npm-packages-${{ hashFiles('**/package-lock.json') }}
- name: Install repo
run: make install
- name: Vacuum OpenAPI Spec linter
run: make lint