@@ -8,54 +8,46 @@ inputs:
88 token :
99 description : Codecov upload token
1010 required : true
11- follow-symbolic-links :
12- description : |
13- Indicates whether to follow symbolic links when resolving `path`
14- default : ' true'
1511 override-commit :
1612 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
2319 override-branch :
2420 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
3127 override-pr :
3228 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
4535 override-build :
4636 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
5240 override-build-url :
5341 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'
5951
6052outputs :
6153 groups :
@@ -78,18 +70,14 @@ runs:
7870 - name : Validate inputs
7971 uses : actions/github-script@v7
8072 env :
81- INPUT_MAP : ${{ toJson(inputs) }}
73+ INPUT_PATH : ${{ inputs.path }}
74+ INPUT_TOKEN : ${{ inputs.token }}
8275 with :
8376 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});
9381
9482 # @TODO move actions to a dedicated repo and remove the checkout
9583 - uses : actions/checkout@v4
@@ -98,15 +86,13 @@ runs:
9886
9987 - name : Load groups metadata
10088 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
10290 with :
10391 path : ${{ inputs.path }}
10492 format : string # String in order to concatenate interesting values
10593 glue-string : ' ,' # Ensure glue string as it's the expected one by the uploader
10694 follow-symbolic-links : ${{ inputs.follow-symbolic-links }}
10795
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 ?
11096 - name : Build uploader option
11197 id : build-uploader-options
11298 uses : actions/github-script@v7
@@ -165,7 +151,7 @@ runs:
165151 const {REPORT_NAME, REPORT_FILES, REPORT_FLAGS, METADATA} = process.env;
166152
167153 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`)
169155 core.setOutput('name', REPORT_NAME);
170156 core.setOutput('reports', REPORT_FILES.split(',').join('\n')); // Trusted path, see `build-uploader-options` step
171157 core.setOutput('flags', undefined !== REPORT_FLAGS ? REPORT_FLAGS.split(',').join('\n') : '');
0 commit comments