Skip to content

Commit

Permalink
Publish 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
FranciscoKnebel committed Aug 31, 2024
1 parent b632db7 commit 526850a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'File Analytics'
description: 'An action to get file size and date from a blob of files'
description: 'An action to get file size and date from a glob of files'
author: 'Francisco Knebel'

inputs:
Expand All @@ -14,7 +14,7 @@ inputs:
default: 'false'

outputs:
file_json:
file_output:
description: 'File metadata in JSON format'
file_info:
description: 'File metadata in text format'
Expand Down
5 changes: 4 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27499,12 +27499,15 @@ const colors = __nccwpck_require__(7023);
module.exports = {
generateOutput_json(output) {
const outputJSON = core.getInput('output_json');
const json = JSON.stringify(output, undefined, 4);

if (outputJSON && outputJSON !== 'false') {
core.debug(`Writing output to JSON in file "${outputJSON}"`);
fs.writeFileSync(outputJSON, JSON.stringify(output, undefined, 4));
fs.writeFileSync(outputJSON, json);
core.info(`Wrote output to JSON in file "${outputJSON}"`);
}

core.setOutput('file_output', json);
},

generateOutput_text(output) {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "file-analytics-action",
"version": "1.0.0",
"name": "file-analytics",
"version": "0.1.0",
"description": "An action to get file size and date from a blob of files",
"main": "src/index.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion src/outputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ const colors = require("picocolors");
module.exports = {
generateOutput_json(output) {
const outputJSON = core.getInput('output_json');
const json = JSON.stringify(output, undefined, 4);

if (outputJSON && outputJSON !== 'false') {
core.debug(`Writing output to JSON in file "${outputJSON}"`);
fs.writeFileSync(outputJSON, JSON.stringify(output, undefined, 4));
fs.writeFileSync(outputJSON, json);
core.info(`Wrote output to JSON in file "${outputJSON}"`);
}

core.setOutput('file_output', json);
},

generateOutput_text(output) {
Expand Down

0 comments on commit 526850a

Please sign in to comment.