Skip to content

Commit 19fdcff

Browse files
committed
Print proxy log when debugging is enabled
1 parent 3242313 commit 19fdcff

6 files changed

+22
-2
lines changed

lib/start-proxy-action-post.js

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/start-proxy-action-post.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/start-proxy-action.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/start-proxy-action.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/start-proxy-action-post.ts

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* It will run after the all steps in this job, in reverse order in relation to
44
* other `post:` hooks.
55
*/
6+
import * as fs from "fs";
7+
68
import * as core from "@actions/core";
79

810
import { wrapError } from "./util";
@@ -18,6 +20,13 @@ async function runWrapper() {
1820
`start-proxy post-action step failed: ${wrapError(error).message}`,
1921
);
2022
}
23+
if (core.isDebug()) {
24+
const logFilePath = core.getState("proxy-log-file");
25+
if (logFilePath) {
26+
const readStream = fs.createReadStream(logFilePath);
27+
readStream.pipe(process.stdout, { end: true });
28+
}
29+
}
2130
}
2231

2332
void runWrapper();

src/start-proxy-action.ts

+2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ async function runWrapper() {
9090
const credentials = JSON.parse(input) as Credential[];
9191
const ca = generateCertificateAuthority();
9292
const proxy_password = actionsUtil.getOptionalInput("proxy_password");
93+
core.saveState("proxy-log-file", logFilePath);
94+
9395
let proxy_auth: BasicAuthCredentials | undefined = undefined;
9496
if (proxy_password) {
9597
core.setSecret(proxy_password);

0 commit comments

Comments
 (0)