Skip to content

Commit

Permalink
DOH
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Aug 23, 2024
1 parent c985ebf commit fe32be8
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 32 deletions.
1 change: 1 addition & 0 deletions dist/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 16 additions & 15 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

34 changes: 18 additions & 16 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ export abstract class DetSysAction {
await this.main();
} else if (this.isPost) {
await this.post();

await this.collectBacktraces();
}
this.addFact(FACT_ENDED_WITH_EXCEPTION, false);
} catch (e: unknown) {
Expand All @@ -413,22 +415,6 @@ export abstract class DetSysAction {
actionsCore.setFailed(reportable);
}

if (this.isPost) {
try {
const backtraces = await collectBacktraces(
this.actionOptions.binaryNamePrefixes,
);
if (backtraces.size > 0) {
actionsCore.debug(`backtraces identified: ${backtraces.size}`);
this.recordEvent(EVENT_BACKTRACES, Object.fromEntries(backtraces));
}
} catch (innerError: unknown) {
actionsCore.debug(
`Error collecting backtraces: ${stringifyError(innerError)}`,
);
}
}

const doGzip = promisify(gzip);

const exceptionContext: Map<string, string> = new Map();
Expand Down Expand Up @@ -777,6 +763,22 @@ export abstract class DetSysAction {
}
}

private async collectBacktraces(): Promise<void> {
try {
const backtraces = await collectBacktraces(
this.actionOptions.binaryNamePrefixes,
);
if (backtraces.size > 0) {
actionsCore.debug(`backtraces identified: ${backtraces.size}`);
this.recordEvent(EVENT_BACKTRACES, Object.fromEntries(backtraces));
}
} catch (innerError: unknown) {
actionsCore.debug(
`Error collecting backtraces: ${stringifyError(innerError)}`,
);
}
}

private async preflightRequireNix(): Promise<boolean> {
let nixLocation: string | undefined;

Expand Down

0 comments on commit fe32be8

Please sign in to comment.