Skip to content

Commit f265dd9

Browse files
committed
Separate generateFailedSarif out of prepareFailedSarif
1 parent 44b66a8 commit f265dd9

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

lib/init-action-post.js

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

src/init-action-post-helper.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,22 @@ async function prepareFailedSarif(
112112
}
113113
const category = getCategoryInputOrThrow(workflow, jobName, matrix);
114114
const checkoutPath = getCheckoutPathInputOrThrow(workflow, jobName, matrix);
115+
116+
const result = await generateFailedSarif(
117+
features,
118+
config,
119+
category,
120+
checkoutPath,
121+
);
122+
return new Success(result);
123+
}
124+
125+
async function generateFailedSarif(
126+
features: FeatureEnablement,
127+
config: Config,
128+
category: string | undefined,
129+
checkoutPath: string,
130+
) {
115131
const databasePath = config.dbLocation;
116132

117133
const codeql = await getCodeQL(config.codeQLCmd);
@@ -128,7 +144,7 @@ async function prepareFailedSarif(
128144
await codeql.databaseExportDiagnostics(databasePath, sarifFile, category);
129145
}
130146

131-
return new Success({ sarifFile, category, checkoutPath });
147+
return { sarifFile, category, checkoutPath };
132148
}
133149

134150
/**

0 commit comments

Comments
 (0)