Skip to content

Commit

Permalink
v1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
selfagency committed Sep 19, 2022
1 parent ba24216 commit faf949c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Capture output
uses: 'selfagency/[email protected].4'
uses: 'selfagency/[email protected].6'
with:
cmd: yarn
args: run,build,--verbose
Expand Down
9 changes: 7 additions & 2 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2690,7 +2690,7 @@ var require_toolrunner = __commonJS({
var events = __importStar(require("events"));
var child = __importStar(require("child_process"));
var path = __importStar(require("path"));
var io = __importStar(require_io());
var io2 = __importStar(require_io());
var ioUtil = __importStar(require_io_util());
var timers_1 = require("timers");
var IS_WINDOWS = process.platform === "win32";
Expand Down Expand Up @@ -2897,7 +2897,7 @@ var require_toolrunner = __commonJS({
if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) {
this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
}
this.toolPath = yield io.which(this.toolPath, true);
this.toolPath = yield io2.which(this.toolPath, true);
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
this._debug(`exec tool: ${this.toolPath}`);
this._debug("arguments:");
Expand Down Expand Up @@ -3222,6 +3222,7 @@ var import_perf_hooks = require("perf_hooks");
var import_promises = require("fs/promises");
var import_core = __toESM(require_core(), 1);
var import_exec = __toESM(require_exec(), 1);
var import_io = __toESM(require_io(), 1);
var errorOut = (data, hideWarning = false) => {
var _a, _b, _c;
if (((_a = data == null ? void 0 : data.toLowerCase()) == null ? void 0 : _a.includes("error")) && !((_b = data == null ? void 0 : data.toLowerCase()) == null ? void 0 : _b.includes("warn")) && !(data == null ? void 0 : data.includes("ESLint must be installed")) && !(data == null ? void 0 : data.startsWith("error Command failed."))) {
Expand Down Expand Up @@ -3272,6 +3273,10 @@ ${output}`);
import_core.default.setOutput("stdout", stdout);
import_core.default.setOutput("stderr", stderr);
if (file) {
const path = file.split("/");
path.pop();
const dir = path.join("/");
await import_io.default.mkdirP(dir);
await (0, import_promises.writeFile)(file, output);
}
if (fail && exitCode != 0) {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "capture-output",
"version": "1.0.5",
"version": "1.0.6",
"description": "Capture the output (and duration) of a command as a GitHub Actions `output` or file",
"repository": {
"type": "git",
Expand All @@ -26,7 +26,8 @@
},
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/exec": "^1.1.1"
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2"
},
"devDependencies": {
"@types/node": "^18.7.18",
Expand Down
5 changes: 5 additions & 0 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { performance } from 'perf_hooks';
import { writeFile } from 'fs/promises';
import core from '@actions/core';
import exec from '@actions/exec';
import io from '@actions/io';

const errorOut = (data: string, hideWarning = false) => {
if (
Expand Down Expand Up @@ -61,6 +62,10 @@ const errorOut = (data: string, hideWarning = false) => {
core.setOutput('stderr', stderr);

if (file) {
const path = file.split('/');
path.pop();
const dir = path.join('/');
await io.mkdirP(dir);
await writeFile(file, output);
}

Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
dependencies:
tunnel "^0.0.6"

"@actions/io@^1.0.1":
"@actions/io@^1.0.1", "@actions/io@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@actions/io/-/io-1.1.2.tgz#766ac09674a289ce0f1550ffe0a6eac9261a8ea9"
integrity sha512-d+RwPlMp+2qmBfeLYPLXuSRykDIFEwdTA0MMxzS9kh4kvP1ftrc/9fzy6pX6qAjthdXruHQ6/6kjT/DNo5ALuw==
Expand Down

0 comments on commit faf949c

Please sign in to comment.