mirror of
https://github.com/github/codeql-action.git
synced 2025-12-29 02:30:11 +08:00
Print proxy log when debugging is enabled
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
* It will run after the all steps in this job, in reverse order in relation to
|
||||
* other `post:` hooks.
|
||||
*/
|
||||
import * as fs from "fs";
|
||||
|
||||
import * as core from "@actions/core";
|
||||
|
||||
import { wrapError } from "./util";
|
||||
@@ -18,6 +20,13 @@ async function runWrapper() {
|
||||
`start-proxy post-action step failed: ${wrapError(error).message}`,
|
||||
);
|
||||
}
|
||||
if (core.isDebug()) {
|
||||
const logFilePath = core.getState("proxy-log-file");
|
||||
if (logFilePath) {
|
||||
const readStream = fs.createReadStream(logFilePath);
|
||||
readStream.pipe(process.stdout, { end: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void runWrapper();
|
||||
|
||||
@@ -90,6 +90,8 @@ async function runWrapper() {
|
||||
const credentials = JSON.parse(input) as Credential[];
|
||||
const ca = generateCertificateAuthority();
|
||||
const proxy_password = actionsUtil.getOptionalInput("proxy_password");
|
||||
core.saveState("proxy-log-file", logFilePath);
|
||||
|
||||
let proxy_auth: BasicAuthCredentials | undefined = undefined;
|
||||
if (proxy_password) {
|
||||
core.setSecret(proxy_password);
|
||||
|
||||
Reference in New Issue
Block a user