Skip to content

Commit 76baae4

Browse files
committed
v1 release
1 parent 5de3b3d commit 76baae4

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

.idea/workspace.xml

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

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
name:
66
description: 'The name of the file to be written.'
77
required: true
8-
json-string:
8+
object:
99
description: 'The json string that can be a secret of the github repo.'
1010
required: true
1111
dir:

index.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const fs = require('fs');
33
const path = require("path");
44

55
const fileName = core.getInput('name');
6-
const jsonString = core.getInput('json-string');
6+
const jsonString = core.getInput('object');
77
const dir = core.getInput('dir');
88
const fullPath = path.join(process.env.GITHUB_WORKSPACE, dir || "", fileName);
99

@@ -16,13 +16,23 @@ console.log(fullPath)
1616

1717
fs.writeFile(fullPath, fileContent, function (error) {
1818

19-
console.log('Writing')
2019

2120
if (error) {
22-
console.log('ERROR')
2321
core.setFailed(error.message);
2422
}
2523

24+
let obj;
25+
26+
fs.readFile(fullPath,null, handleFile)
27+
28+
function handleFile(err, data) {
29+
if (err) throw err
30+
obj = JSON.parse(data)
31+
console.log("Object: ", obj)
32+
}
33+
34+
35+
2636
core.setOutput("success", "Successfully created json file.");
2737
});
2838

0 commit comments

Comments
 (0)