Skip to content

Commit

Permalink
feat: add suport to receive path of result
Browse files Browse the repository at this point in the history
  • Loading branch information
jonataspinto committed May 1, 2022
1 parent e4e954f commit 1fdaa47
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: "Read Result of tests"
description: "Greet someone and record the time"
inputs:
resultPath: # id of input
description: "Path to result file"
required: false
default: "./result.json"
outputs:
resultOfOutputTests:
description: "A result of tests parsed to string"
Expand Down
6 changes: 4 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1969,10 +1969,12 @@ var __webpack_exports__ = {};
(() => {
const fs = __nccwpck_require__(147);
const core = __nccwpck_require__(469);
const jestOuputFile = fs.readFileSync("./result.json");
const data = JSON.parse(jestOuputFile)


try {
const resultPath = core.getInput('resultPath');
const jestOuputFile = fs.readFileSync(resultPath);
const data = JSON.parse(jestOuputFile)
core.setOutput("resultOfOutputTests", JSON.stringify(data));
} catch (error) {
core.setFailed(error.message);
Expand Down
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const fs = require("fs");
const core = require('@actions/core');
const jestOuputFile = fs.readFileSync("./result.json");
const data = JSON.parse(jestOuputFile)


try {
const resultPath = core.getInput('resultPath');
const jestOuputFile = fs.readFileSync(resultPath);
const data = JSON.parse(jestOuputFile)
core.setOutput("resultOfOutputTests", JSON.stringify(data));
} catch (error) {
core.setFailed(error.message);
Expand Down
29 changes: 29 additions & 0 deletions package-lock.json

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

0 comments on commit 1fdaa47

Please sign in to comment.