Skip to content

Commit bbfb0cb

Browse files
authored
Refactor CI for forked repositories - fin-action - glob output format (#120)
1 parent 6fc9ce9 commit bbfb0cb

File tree

5 files changed

+8
-20
lines changed

5 files changed

+8
-20
lines changed

.github/actions/reports-group/find-action/action.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,15 @@ description: |
33
Find reports group directory under the provided `path`
44
inputs:
55
path:
6-
description: A group directory or a glob pattern in order to find group directories and merge their metadata
6+
description: A group directory, or a glob pattern in order to find underlying group directories
77
required: true
8-
format:
9-
description: |
10-
`string` (default) or `json`
11-
required: false
12-
default: 'string'
13-
glue-string:
14-
description: String used to concatenate values when 'string' format is used
15-
required: false
16-
default: ','
178
follow-symbolic-links:
189
description: Indicates whether to follow symbolic links when resolving `path`
1910
required: false
2011
default: 'false'
2112
outputs:
2213
list:
23-
description: |
24-
List of group paths separated by `glue-string` with `string` format. Or a JSON encoded list with `json` format
14+
description: Glob compatible list of reports group directory path (=multiline list of paths)
2515

2616
runs:
2717
using: 'node20'

.github/actions/reports-group/find-action/dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/reports-group/find-action/dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/reports-group/find-action/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ async function run() {
88
const trustedPathConverter = SDK.path.trustedPathHelpers();
99
/** INPUTS **/
1010
const PATH_INPUT = core.getInput('path', {required: true});
11+
1112
// Following inputs are not marked as required by the action but a default value must be there, so using `required` works
12-
const FORMAT_INPUT = core.getInput('format', {required: true});
13-
const GLUE_STRING_INPUT = core.getInput('glue-string', {required: true, trimWhitespace: false});
1413
const FOLLOW_SYMLINK_INPUT = core.getBooleanInput('follow-symbolic-links', {required: true});
1514

1615
const trustedGroupPaths = await core.group(
@@ -34,8 +33,7 @@ async function run() {
3433
const res = {};
3534

3635
core.info("Build 'list' output");
37-
const list = trustedGroupPaths.map(v => SDK.path.withTrailingSeparator(v));
38-
res.list = 'json' === FORMAT_INPUT ? JSON.stringify(list) : list.join(GLUE_STRING_INPUT)
36+
res.list = trustedGroupPaths.map(v => SDK.path.withTrailingSeparator(v)).join('\n');
3937

4038
return res;
4139
}

.github/workflows/codecov-upload-from-artifacts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
uses: ./custom-action-repo/.github/actions/reports-group/find-action
115115
with:
116116
path: job-artifacts
117-
format: json
117+
follow-symbolic-links: ${{ inputs.follow-symbolic-links }}
118118

119119
- name: DEBUG
120120
run: echo '${{ toJson(steps.find-groups.outputs) }}'
@@ -130,7 +130,7 @@ jobs:
130130
script: |
131131
const {resolve: pathResolve, join: pathJoin, sep: pathSep} = require('path');
132132
const {PATH_LIST} = process.env;
133-
const pathList = JSON.parse(PATH_LIST);
133+
const pathList = PATH_LIST.split('\n');
134134
const artifactDirectory = pathResolve('job-artifacts')
135135
136136
const result = pathList.map(groupPath => {

0 commit comments

Comments
 (0)