Skip to content

Commit 489d1f7

Browse files
committed
Improve
1 parent 032e9c8 commit 489d1f7

File tree

19 files changed

+62
-61
lines changed

19 files changed

+62
-61
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

.github/actions/reports-group/attach-check-run-to-triggering-workflow-action/dist/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/reports-group/attach-check-run-to-triggering-workflow-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/attach-check-run-to-triggering-workflow-action/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const core = require("@actions/core"); // @TODO move to 'imports from' when moved to TS !
22

3-
if (!!core.getState('check-run-id')) {
3+
if (!!core.getState('has-been-triggered')) {
44
require('./src/cleanup');
55
} else {
66
require('./src/main');

.github/actions/reports-group/attach-check-run-to-triggering-workflow-action/src/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const ghaHelpers = require('../node-gha-helpers');
66
const formatMarkdownUrl = (title, link) => '<a href="' + link + '" target="blank">' + title + '</a>';
77

88
async function run() {
9+
core.saveState('has-been-triggered', 1);
910
/** INPUTS **/
1011
const githubToken = core.getInput('github-token', {required: true});
1112
const jobStatus = core.getInput('job-status', {required: true});
@@ -71,6 +72,6 @@ async function run() {
7172
}
7273

7374
run().catch(e => {
74-
core.info('Error caught and ignored ' + e.message);
75+
core.warning('Error caught and ignored ' + e.message);
7576
core.debug('Error=' + JSON.stringify(e));
7677
});

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

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/reports-group/create-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/dist/index.js

Lines changed: 2 additions & 2 deletions
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: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ const core = require('@actions/core'); // @TODO move to 'imports from' when move
55

66
const SDK = require('./node-sdk'); // @TODO move to 'imports from' when moved to TS !
77

8-
// @TODO replace json by glob-string as output ?? Same as string format but with glob compatible path list
9-
10-
// (easier to manage for inner code, while end-user is still able to fall back on string format with a simple split)
118
async function run() {
129
const trustedPathConverter = SDK.path.trustedPathHelpers();
1310
/** INPUTS **/
@@ -36,18 +33,25 @@ async function run() {
3633
core.debug('Filter metadata list');
3734
trustedMetadataList = SDK.filter.filterMetadataList(
3835
trustedMetadataList,
39-
core.getMultilineInput('exclude-groups'), core.getMultilineInput('exclude-formats'), core.getMultilineInput('exclude-flags'), core.getMultilineInput('exclude-paths'),
40-
core.getMultilineInput('only-include-groups'), core.getMultilineInput('only-include-formats'), core.getMultilineInput('only-include-flags'), core.getMultilineInput('only-include-paths')
41-
);
36+
{
37+
groups: core.getMultilineInput('exclude-groups'),
38+
formats: core.getMultilineInput('exclude-formats'),
39+
flags: core.getMultilineInput('exclude-flags'),
40+
paths: core.getMultilineInput('exclude-paths'),
41+
},
42+
{
43+
groups: core.getMultilineInput('only-include-groups'),
44+
formats: core.getMultilineInput('only-include-formats'),
45+
flags: core.getMultilineInput('only-include-flags'),
46+
paths: core.getMultilineInput('only-include-paths')
47+
}
48+
)
4249
core.debug('New metadata list=' + JSON.stringify(trustedMetadataList));
4350
// Apply `artifacts` mode if needed
4451
if (ENABLE_ARTIFACT_MODE) {
4552
core.debug('Apply artifact mode');
46-
if (trustedPathInput.split('\n').length !== 1 || trustedPathInput.includes('*') || trustedPathInput.includes('?') || trustedPathInput.includes(']')) {
47-
core.setFailed('You must provide a single valid path when `artifacts-mode` option is enabled !')
48-
}
4953
if (!statSync(trustedPathInput).isDirectory()) {
50-
core.setFailed('You must provide a single valid path when `artifacts-mode` option is enabled !')
54+
core.setFailed('Provided path is not a valid directory. You must provide a single valid path when `artifacts-mode` is enabled !')
5155
}
5256
const artifactDownloadDirectory = SDK.path.withTrailingSeparator(path.resolve(trustedPathInput));
5357
const artifactList = new Set();
@@ -59,8 +63,7 @@ async function run() {
5963

6064
metadata.artifact = artifactName;
6165
artifactList.add(metadata.artifact);
62-
metadata.path = pathFromDwlDirectory;
63-
metadata.path = SDK.path.withTrailingSeparator(0 === metadata.path.length ? '.' : metadata.path);
66+
metadata.path = SDK.path.withTrailingSeparator(0 === pathFromDwlDirectory.length ? '.' : pathFromDwlDirectory);
6467
metadata.reports = metadata.reports.map(v => path.relative(v, artifactDownloadDirectory));
6568

6669
return metadata;
@@ -85,8 +88,7 @@ async function run() {
8588
let trustedMetadataListOfList = [trustedMetadataList];
8689
/** @type {MergeField[]} */
8790
const groupByItemList = GROUP_BY_INPUT.length > 0 ? GROUP_BY_INPUT.split(',') : [];
88-
const isMultiGroup = groupByItemList.length > 0;
89-
if (isMultiGroup) {
91+
if (groupByItemList.length > 0) {
9092
core.info('Merge metadata list');
9193
trustedMetadataListOfList = SDK.merge.groupMetadataList(trustedMetadataList, groupByItemList);
9294
core.debug('New metadata list=' + JSON.stringify(trustedMetadataListOfList));

0 commit comments

Comments
 (0)