-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (62 loc) · 1.7 KB
/
ccd-diff.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Diff CCD definition
on:
pull_request:
branches:
- master
jobs:
buildBranch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: build/branch
- uses: actions/upload-artifact@v3
with:
name: branch
path: build/branch/definitions/benefit/sheets/*
buildMaster:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
path: build/master
- uses: actions/upload-artifact@v3
with:
name: master
path: build/master/definitions/benefit/sheets/*
report:
runs-on: ubuntu-latest
needs: [buildBranch, buildMaster]
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/download-artifact@v3
with:
name: branch
path: build/branch
- uses: actions/download-artifact@v3
with:
name: master
path: build/master
- name: Generate report
id: ccd-diff
run: |
REPORT="$(npx -q @hmcts/ccd-diff build/master build/branch)"
REPORT="${REPORT//'%'/'%25'}"
REPORT="${REPORT//$'\n'/'%0A'}"
REPORT="${REPORT//$'\r'/'%0D'}"
echo $REPORT
echo "::set-output name=content::$REPORT"
- name: Display
run: |
echo "${{ steps.ccd-diff.outputs.content }}"
- name: Add report
uses: thollander/actions-comment-pull-request@v1
with:
message: |
# CCD diff report
${{ steps.ccd-diff.outputs.content }}
comment_includes: CCD diff report
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}