Skip to content

Commit 526850a

Browse files
Publish 0.1.0
1 parent b632db7 commit 526850a

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'File Analytics'
2-
description: 'An action to get file size and date from a blob of files'
2+
description: 'An action to get file size and date from a glob of files'
33
author: 'Francisco Knebel'
44

55
inputs:
@@ -14,7 +14,7 @@ inputs:
1414
default: 'false'
1515

1616
outputs:
17-
file_json:
17+
file_output:
1818
description: 'File metadata in JSON format'
1919
file_info:
2020
description: 'File metadata in text format'

dist/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27499,12 +27499,15 @@ const colors = __nccwpck_require__(7023);
2749927499
module.exports = {
2750027500
generateOutput_json(output) {
2750127501
const outputJSON = core.getInput('output_json');
27502+
const json = JSON.stringify(output, undefined, 4);
2750227503

2750327504
if (outputJSON && outputJSON !== 'false') {
2750427505
core.debug(`Writing output to JSON in file "${outputJSON}"`);
27505-
fs.writeFileSync(outputJSON, JSON.stringify(output, undefined, 4));
27506+
fs.writeFileSync(outputJSON, json);
2750627507
core.info(`Wrote output to JSON in file "${outputJSON}"`);
2750727508
}
27509+
27510+
core.setOutput('file_output', json);
2750827511
},
2750927512

2751027513
generateOutput_text(output) {

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "file-analytics-action",
3-
"version": "1.0.0",
2+
"name": "file-analytics",
3+
"version": "0.1.0",
44
"description": "An action to get file size and date from a blob of files",
55
"main": "src/index.js",
66
"scripts": {

src/outputs.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ const colors = require("picocolors");
88
module.exports = {
99
generateOutput_json(output) {
1010
const outputJSON = core.getInput('output_json');
11+
const json = JSON.stringify(output, undefined, 4);
1112

1213
if (outputJSON && outputJSON !== 'false') {
1314
core.debug(`Writing output to JSON in file "${outputJSON}"`);
14-
fs.writeFileSync(outputJSON, JSON.stringify(output, undefined, 4));
15+
fs.writeFileSync(outputJSON, json);
1516
core.info(`Wrote output to JSON in file "${outputJSON}"`);
1617
}
18+
19+
core.setOutput('file_output', json);
1720
},
1821

1922
generateOutput_text(output) {

0 commit comments

Comments
 (0)