@@ -8,54 +8,46 @@ inputs:
8
8
token :
9
9
description : Codecov upload token
10
10
required : true
11
- follow-symbolic-links :
12
- description : |
13
- Indicates whether to follow symbolic links when resolving `path`
14
- default : ' true'
15
11
override-commit :
16
12
description : |
17
- Commit to link to the uploaded reports.
18
- Default value:
19
- - `push` workflow: `github.sha`
20
- - `pull_request` workflow: `github.event. pull_request.head.sha`
21
- - `workflow_run` workflow triggered by a `pull_request` or `push` workflow: `github.event.workflow_run.head_sha`
22
- default : " ${{ ('workflow_run' == github.event_name && ('pull_request' == github.event.workflow_run.event || 'push' == github.event.workflow_run.event) && github.event.workflow_run.head_sha) || ('pull_request' == github.event_name && github.event.pull_request.head.sha) || ('push' == github.event_name && github.sha) || null }} "
13
+ Force the commit SHA linked to the uploaded reports.
14
+ Mostly useful for specific cases (e.g. `workflow_run` workflow).
15
+
16
+ In case input is filled, `override-branch` input (as well as `override-pr` in case of ` pull_request` event)
17
+ should be filled too in order to keep consitency between values !
18
+ required : false
23
19
override-branch :
24
20
description : |
25
- Branch to link to the uploaded reports.
26
- Default value:
27
- - `push` workflow: `github.ref_name` *if `github.ref_type` equals `branch`
28
- - `pull_request` workflow: `github.event. pull_request.head.ref`
29
- - `workflow_run` workflow triggered by a `pull_request` or `push` workflow: `github.event.workflow_run.head_branch`
30
- default : " ${{ ('workflow_run' == github.event_name && ('pull_request' == github.event.workflow_run.event || 'push' == github.event.workflow_run.event) && github.event.workflow_run.head_branch) || ('pull_request' == github.event_name && github.event.pull_request.head.ref) || ('push' == github.event_name && 'branch' == github.ref_type && github.ref_name) || null }} "
21
+ Force the branch linked to the uploaded reports.
22
+ Mostly useful for specific cases (e.g. `workflow_run` workflow).
23
+
24
+ In case input is filled, `override-commit` input (as well as `override-pr` in case of ` pull_request` event)
25
+ should be filled too in order to keep consitency between values !
26
+ required : false
31
27
override-pr :
32
28
description : |
33
- PR to link to the uploaded reports.
34
- Default value:
35
- - `pull_request` workflow: `github.event.number`
36
- - `workflow_run` workflow triggered by a `pull_request` workflow: `github.event.workflow_run.pull_requests[0].number`
37
- default : " ${{ ( 'workflow_run' == github.event_name && 'pull_request' == github.event.workflow_run.event && github.event.workflow_run.pull_requests[0] && github.event.workflow_run.pull_requests[0].number) || ('pull_request' == github.event_name && github.event.number) || null }}"
38
- # commit-parent: # @TODO Not sure what it is (enable debug mode during upload to see what is actually sent by the uploader)
39
- # description: |
40
- # Parent commit to link to the uploaded reports. Most likely only useful for PR.
41
- # Default value:
42
- # - `pull_request` workflow: `github.event.number`
43
- # - `workflow_run` workflow triggered by a `pull_request` workflow: `github.event.workflow_run.pull_requests[0].number`
44
- # default: "${{ ('workflow_run' == github.event_name && ('pull_request' == github.event.workflow_run.event || 'push' == github.event.workflow_run.event) && github.event.workflow_run.head_branch) || ('pull_request' == github.event_name && github.event.pull_request.head.ref) || ('push' == github.event_name && github.sha) || null }}"
29
+ Force the PR linked to the uploaded reports.
30
+ Mostly useful for specific cases (e.g. `workflow_run` workflow triggered by a `pull_request` workflow).
31
+
32
+ In case input is filled, `override-commit` and `override-branch` inputs should be filled too in order
33
+ to keep consitency between values !
34
+ required : false
45
35
override-build :
46
36
description : |
47
- Workflow run to link to the uploaded reports
48
- Default value:
49
- - `workflow_run` workflow: `github.event.workflow_run.id`
50
- - Else: `github.run_id`
51
- default : " ${{ ('workflow_run' == github.event_name && github.event.workflow_run.id) || github.run_id || null }}"
37
+ Workflow run ID to link to the uploaded reports.
38
+ Mostly useful for specific cases (e.g. `workflow_run` workflow).
39
+ required : false
52
40
override-build-url :
53
41
description : |
54
- Workflow run url to link to the uploaded reports
55
- Default value:
56
- - `workflow_run` workflow: `github.event.workflow_run.id`
57
- - Else: `github.run_id`
58
- default : " ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ ('workflow_run' == github.event_name && github.event.workflow_run.id) || github.run_id }}"
42
+ Workflow run url to link to the uploaded reports.
43
+ Usually something like `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}` (based on GHA environment variables).
44
+ Mostly useful for specific cases (e.g. `workflow_run` workflow).
45
+
46
+ In case input is filled, `override-build` input most likely need to be filled too in order to keep consitency between values !
47
+ required : false
48
+ follow-symbolic-links :
49
+ description : Indicates whether to follow symbolic links when resolving `path`
50
+ default : ' false'
59
51
60
52
outputs :
61
53
groups :
@@ -78,18 +70,14 @@ runs:
78
70
- name : Validate inputs
79
71
uses : actions/github-script@v7
80
72
env :
81
- INPUT_MAP : ${{ toJson(inputs) }}
73
+ INPUT_PATH : ${{ inputs.path }}
74
+ INPUT_TOKEN : ${{ inputs.token }}
82
75
with :
83
76
script : |
84
- return core.group(
85
- 'Validate inputs',
86
- async () => Object.entries(JSON.parse(process.env.INPUT_MAP))
87
- .forEach(([key, val]) => {
88
- if (!key.startsWith('override-') && !val.trim()) {
89
- throw new Error(`Input required and not supplied: ${key}`);
90
- }
91
- })
92
- );
77
+ core.info('Validate inputs');
78
+
79
+ core.getInput('path', {required: true});
80
+ core.getInput('token', {required: true});
93
81
94
82
# @TODO move actions to a dedicated repo and remove the checkout
95
83
- uses : actions/checkout@v4
@@ -98,15 +86,13 @@ runs:
98
86
99
87
- name : Load groups metadata
100
88
id : load-metadata
101
- uses : ./custom-action-repo/.github/actions/reports-group/load-metadata
89
+ uses : ./custom-action-repo/.github/actions/reports-group/load-metadata-action
102
90
with :
103
91
path : ${{ inputs.path }}
104
92
format : string # String in order to concatenate interesting values
105
93
glue-string : ' ,' # Ensure glue string as it's the expected one by the uploader
106
94
follow-symbolic-links : ${{ inputs.follow-symbolic-links }}
107
95
108
- # @TODO Use bash instead and rely on JQ ?
109
- # Or create an *internal* action (not published on marketplace and stored inside this action repo) taking metadata JSON as input and returning each property the uploader has ?
110
96
- name : Build uploader option
111
97
id : build-uploader-options
112
98
uses : actions/github-script@v7
@@ -165,7 +151,7 @@ runs:
165
151
const {REPORT_NAME, REPORT_FILES, REPORT_FLAGS, METADATA} = process.env;
166
152
167
153
const metadata = JSON.parse(METADATA);
168
- core.setOutput('group ', metadata.path.split(',').join('\n')); // Trusted path as it comes from trusted metadata (=from `reports-group/load-metadata`)
154
+ core.setOutput('groups ', metadata.path.split(',').join('\n')); // Trusted path as it comes from trusted metadata (=from `reports-group/load-metadata`)
169
155
core.setOutput('name', REPORT_NAME);
170
156
core.setOutput('reports', REPORT_FILES.split(',').join('\n')); // Trusted path, see `build-uploader-options` step
171
157
core.setOutput('flags', undefined !== REPORT_FLAGS ? REPORT_FLAGS.split(',').join('\n') : '');
0 commit comments