-
Notifications
You must be signed in to change notification settings - Fork 32
/
action.yml
127 lines (127 loc) · 5.26 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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Python Coverage Comment
branding:
icon: "umbrella"
color: "purple"
description: >
Publish diff coverage report as PR comment, and create a coverage badge
to display on the readme.
inputs:
GITHUB_TOKEN:
description: >
A GitHub token to write comments and write the badge & coverage data
to the repository.
Set to `$ {{ github.token }}` (without the space between `$` and `{`).
required: true
GITHUB_PR_RUN_ID:
description: >
Only useful on the "workflow_run" part of the workflow.
Set to `$ {{ github.event.workflow_run.id }}` (without the space between `$` and `{`).
required: false
COMMENT_TEMPLATE:
description: >
[Advanced] Specify a different template for the comments that will be written on
the PR. See the Action README documentation for how to use this properly.
required: false
COVERAGE_DATA_BRANCH:
description: >
Name of the branch in which coverage data will be stored on the repository.
Default is 'python-coverage-comment-action-data'. Please make sure that this
branch is not protected.
In monorepo setting, see SUBPROJECT_ID.
default: python-coverage-comment-action-data
required: false
COVERAGE_PATH:
description: >
Path to the directory under the git root where the coverage data is
stored. Default is '.'.
default: "."
required: false
COMMENT_ARTIFACT_NAME:
description: >
Name of the artifact in which the body of the comment to post on the PR is stored.
You typically don't have to change this unless you're already using this name for something else.
default: python-coverage-comment-action
required: false
COMMENT_FILENAME:
description: >
Name of the file in which the body of the comment to post on the PR is stored.
In monorepo setting, see SUBPROJECT_ID.
default: python-coverage-comment-action.txt
required: false
SUBPROJECT_ID:
description: >
This setting is only necessary if you plan to run the action multiple
times in the same repository. It will be appended to the value of all the
settings that need to be unique, so as for the action to avoid mixing up
results of multiple runs. Ideally, use dashes (`-`) rather than
underscrores (`_`) to split words, for consistency.
Affects `COMMENT_FILENAME`, `COVERAGE_DATA_BRANCH`.
default: null
required: false
MINIMUM_GREEN:
description: >
If the coverage percentage is above or equal to this value, the badge
will be green.
default: 100
required: false
MINIMUM_ORANGE:
description: >
If the coverage percentage is not green and above or equal to this value,
the badge will be orange. Otherwise it will be red.
default: 70
required: false
MAX_FILES_IN_COMMENT:
description: >
Maximum number of files to display in the comment. If there are more
files than this number, they will only appear in the workflow summary.
The selected files are the ones with the most new uncovered lines. The
closer this number gets to 35, the higher the risk that it reaches
GitHub's maximum comment size limit of 65536 characters. If you want
more files, you may need to use a custom comment template.
(Feel free to open an issue.)
default: 25
required: false
MERGE_COVERAGE_FILES:
description: >
If true, will run `coverage combine` before reading the `.coverage` file.
default: false
ANNOTATE_MISSING_LINES:
description: >
If true, will create an annotation on every line with missing coverage on a pull request.
default: false
ANNOTATION_TYPE:
description: >
Only relevant if ANNOTATE_MISSING_LINES is set to true. This parameter allows you to choose between
notice, warning and error as annotation type. For more information look here:
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-notice-message
default: warning
VERBOSE:
description: >
Deprecated, see https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging
default: false
outputs:
COMMENT_FILE_WRITTEN:
description: >
This output is only set when running in PR mode. It's a boolean indicating
whether a comment file was written to COMMENT_FILENAME or not. If so,
you'll need to run the action in workflow_run mode to post it. If
"false", no comment file was written (likely because the comment was
already posted to the PR).
runs:
using: docker
image: Dockerfile
env:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
GITHUB_PR_RUN_ID: ${{ inputs.GITHUB_PR_RUN_ID }}
COMMENT_TEMPLATE: ${{ inputs.COMMENT_TEMPLATE }}
COVERAGE_DATA_BRANCH: ${{ inputs.COVERAGE_DATA_BRANCH }}
COVERAGE_PATH: ${{ inputs.COVERAGE_PATH }}
COMMENT_ARTIFACT_NAME: ${{ inputs.COMMENT_ARTIFACT_NAME }}
COMMENT_FILENAME: ${{ inputs.COMMENT_FILENAME }}
SUBPROJECT_ID: ${{ inputs.SUBPROJECT_ID }}
MINIMUM_GREEN: ${{ inputs.MINIMUM_GREEN }}
MINIMUM_ORANGE: ${{ inputs.MINIMUM_ORANGE }}
MERGE_COVERAGE_FILES: ${{ inputs.MERGE_COVERAGE_FILES }}
ANNOTATE_MISSING_LINES: ${{ inputs.ANNOTATE_MISSING_LINES }}
ANNOTATION_TYPE: ${{ inputs.ANNOTATION_TYPE }}
VERBOSE: ${{ inputs.VERBOSE }}