Skip to content

Commit a9c1d1c

Browse files
committed
Try upload teh proxy logs
1 parent 7baf392 commit a9c1d1c

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

lib/start-proxy-action-post.js

Lines changed: 11 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/start-proxy-action-post.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +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";
6+
import * as artifact from "@actions/artifact";
7+
78

89
import * as core from "@actions/core";
910

@@ -29,9 +30,22 @@ async function runWrapper() {
2930

3031
if ((config && config.debugMode) || core.isDebug()) {
3132
const logFilePath = core.getState("proxy-log-file");
32-
if (logFilePath) {
33-
const readStream = fs.createReadStream(logFilePath);
34-
readStream.pipe(process.stdout, { end: true });
33+
core.info(
34+
"Debug mode is on. Uploading proxy log as Actions debugging artifact...",
35+
);
36+
try {
37+
await artifact.create().uploadArtifact(
38+
"proxy-log-file",
39+
[logFilePath],
40+
actionsUtil.getTemporaryDirectory(),
41+
{
42+
continueOnError: true,
43+
retentionDays: 7,
44+
},
45+
);
46+
} catch (e) {
47+
// A failure to upload debug artifacts should not fail the entire action.
48+
core.warning(`Failed to upload debug artifacts: ${e}`);
3549
}
3650
}
3751
}

0 commit comments

Comments
 (0)