Skip to content

Commit 3d3dccf

Browse files
authored
Merge pull request #14 from github/better-feedback-folder-uploads
Improve feedback about what files are being uploaded in the upload-sarif Action.
2 parents 5bceb2b + 8ff10b4 commit 3d3dccf

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lib/upload-lib.js

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

src/upload-lib.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ export async function upload(input: string) {
109109
const sarifFiles = fs.readdirSync(input)
110110
.filter(f => f.endsWith(".sarif"))
111111
.map(f => path.resolve(input, f));
112+
if (sarifFiles.length === 0) {
113+
core.setFailed("No SARIF files found to upload in \"" + input + "\".");
114+
return;
115+
}
112116
await uploadFiles(sarifFiles);
113117
} else {
114118
await uploadFiles([input]);
@@ -134,7 +138,7 @@ async function uploadFiles(sarifFiles: string[]) {
134138
const analysisName = util.getRequiredEnvParam('GITHUB_WORKFLOW');
135139
const startedAt = process.env[sharedEnv.CODEQL_ACTION_STARTED_AT];
136140

137-
core.debug("Uploading sarif files: " + JSON.stringify(sarifFiles));
141+
core.info("Uploading sarif files: " + JSON.stringify(sarifFiles));
138142
let sarifPayload = combineSarifFiles(sarifFiles);
139143
sarifPayload = fingerprints.addFingerprints(sarifPayload);
140144

0 commit comments

Comments
 (0)