-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
42 lines (41 loc) · 1.42 KB
/
action.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
name: 'Coverage Notes'
description: 'Code coverage integration using git-notes'
branding:
icon: info
color: purple
inputs:
jacoco:
description: 'Path to Jacoco coverage XML. One of jacoco or cobertura params is required.'
required: false
cobertura:
description: 'Path to Cobertura coverage XML. One of jacoco or cobertura params is required.'
required: false
parser_version:
description: 'Parser version'
required: true
default: '0.4.2'
notes_ref:
description: 'Notes ref'
required: true
default: notes/coverage
repo_token:
description: 'Github token with permission to push and comment on PR'
required: true
runs:
using: composite
steps:
- shell: bash
run: echo "${{ github.action_path }}" >> $GITHUB_PATH
- shell: bash
run: download_parser.sh ${{ inputs.parser_version }}
- name: PR opened
if: ${{ github.event_name == 'push' }}
shell: bash
run: >
./coverage-notes --notes_ref ${{ inputs.notes_ref }}
${{ inputs.jacoco && format('--jacoco {0}', inputs.jacoco) || (inputs.cobertura && format('--cobertura {0}', inputs.cobertura)) }}
--github_token ${{ inputs.repo_token }} create-commit
- name: PR opened
if: github.event.pull_request
shell: bash
run: ./coverage-notes --notes_ref ${{ inputs.notes_ref }} --github_token ${{ inputs.repo_token }} create-pr --pr_number ${{ github.event.number }}