-
Notifications
You must be signed in to change notification settings - Fork 10
55 lines (49 loc) · 1.75 KB
/
base-update.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
45
46
47
48
49
50
51
52
53
54
55
name: Update coverage comment
on:
pull_request:
types: [edited]
jobs:
hello_world_job:
runs-on: ubuntu-latest
name: Test and report
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1000
- name: Fetch base
run: git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1000
- name: Download artifact
uses: dawidd6/action-download-artifact@v2.24.2
continue-on-error: true
with:
workflow: ${{ github.event.pull_request.base.ref == 'main' && 'default-branch.yml' || 'main.yml' }}
workflow_conclusion: success
commit: ${{github.event.pull_request.base.sha}}
name: 'test-coverage-output'
path: base-artifacts
search_artifacts: true
- name: Download artifact
uses: dawidd6/action-download-artifact@v2.24.2
continue-on-error: true
with:
workflow: 'main.yml'
workflow_conclusion: success
commit: ${{github.event.pull_request.head.sha}}
name: 'test-coverage-output'
path: artifacts
search_artifacts: true
- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v1
with:
files: 'base-artifacts/coverage-summary.json, artifacts/coverage-summary.json'
- name: File exists
uses: ./
if: steps.check_files.outputs.files_exists == 'true'
# Only runs if all of the files exists
with:
coverage_file: 'artifacts/coverage-summary.json'
base_coverage_file: 'base-artifacts/coverage-summary.json'
comment_template_file: 'comment-template.svelte'