Try upload teh proxy logs
This commit is contained in:
parent
7baf39279e
commit
0b84d89476
3 changed files with 33 additions and 10 deletions
17
lib/start-proxy-action-post.js
generated
17
lib/start-proxy-action-post.js
generated
|
|
@ -28,7 +28,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
* It will run after the all steps in this job, in reverse order in relation to
|
||||
* other `post:` hooks.
|
||||
*/
|
||||
const fs = __importStar(require("fs"));
|
||||
const artifact = __importStar(require("@actions/artifact"));
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const actionsUtil = __importStar(require("./actions-util"));
|
||||
const configUtils = __importStar(require("./config-utils"));
|
||||
|
|
@ -46,9 +46,18 @@ async function runWrapper() {
|
|||
const config = await configUtils.getConfig(actionsUtil.getTemporaryDirectory(), core);
|
||||
if ((config && config.debugMode) || core.isDebug()) {
|
||||
const logFilePath = core.getState("proxy-log-file");
|
||||
if (logFilePath) {
|
||||
const readStream = fs.createReadStream(logFilePath);
|
||||
readStream.pipe(process.stdout, { end: true });
|
||||
core.info("Debug mode is on. Uploading proxy log as Actions debugging artifact...");
|
||||
try {
|
||||
await artifact
|
||||
.create()
|
||||
.uploadArtifact("proxy-log-file", [logFilePath], actionsUtil.getTemporaryDirectory(), {
|
||||
continueOnError: true,
|
||||
retentionDays: 7,
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
// A failure to upload debug artifacts should not fail the entire action.
|
||||
core.warning(`Failed to upload debug artifacts: ${e}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue