Skip to content

Commit f315931

Browse files
committed
Debug
1 parent 6a42239 commit f315931

File tree

9 files changed

+22
-14
lines changed

9 files changed

+22
-14
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async function run() {
7070
reports: trustedReportsMap.map(v => v.filename),
7171
flags: FLAG_LIST_INPUT
7272
};
73-
core.info('Created');
73+
core.info('metadata=' + JSON.stringify(trustedMetadata));
7474

7575
return res;
7676
}
@@ -96,7 +96,7 @@ async function run() {
9696
'Create metadata file',
9797
async () => {
9898
const trustedFp = trustedPathHelper.trust(path.resolve(trustedGroupDirectory, SDK.METADATA_FILENAME));
99-
core.info('Create metadata file at ' + trustedFp + ' with: ' + JSON.stringify(trustedMetadata));
99+
core.info('Create metadata file at ' + trustedFp);
100100

101101
fs.writeFileSync(trustedFp, JSON.stringify(trustedMetadata));
102102
});

.github/actions/reports-group/find/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/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/load-metadata/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/load-metadata/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/load-metadata/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,17 @@ async function run() {
2121
core.setFailed('Unable to retrieve any group. Something wrong most likely happened !');
2222
}
2323

24-
return trustedMetadataPathList.map(async (trustedGroupPath) => {
24+
const res = trustedMetadataPathList.map((trustedGroupPath) => {
2525
core.info('Load '+ trustedGroupPath);
2626

27-
return trustedPathConverter.trustedMetadataUnder(trustedGroupPath);
27+
const innerRes = trustedPathConverter.trustedMetadataUnder(trustedGroupPath);
28+
core.info('DEBUG innerRes='+JSON.stringify(innerRes));
29+
30+
return innerRes;
2831
});
32+
core.info('DEBUG res='+JSON.stringify(res));
33+
34+
return res;
2935
}
3036
);
3137
core.debug('Group paths=' + JSON.stringify(trustedMetadataList));

.github/actions/reports-group/node-sdk/src/path.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function avoidPoisonNullBytesAttack(untrustedPath) {
1616
}
1717
}
1818
function avoidRelativePathAttack(trustedRootPath, untrustedPath) {
19-
const normalizedPath = path.normalize(path.resolve(untrustedPath));
19+
const normalizedPath = path.resolve(untrustedPath);
2020
if (normalizedPath.indexOf(trustedRootPath) !== 0) {
2121
throw new Error(
2222
'Potential "Relative Path" attack detected !\n'
@@ -63,8 +63,10 @@ function trustFrom(workspacePath) {
6363
const trustedReportPaths = untrustedMetadata.reports.map(r => helpers.trust(r));
6464

6565
return {
66-
...untrustedMetadata,
66+
name: untrustedMetadata.name,
67+
format: untrustedMetadata.format,
6768
reports: trustedReportPaths,
69+
flags: untrustedMetadata.flags,
6870
path: trustedGroupPath,
6971
reportPaths: trustedReportPaths.map(trustedFp => helpers.trust(path.join(trustedGroupPath, trustedFp))),
7072
};

0 commit comments

Comments
 (0)