Skip to content

Commit

Permalink
Merge pull request #14 from github/better-feedback-folder-uploads
Browse files Browse the repository at this point in the history
Improve feedback about what files are being uploaded in the upload-sarif Action.
  • Loading branch information
Chris Gavin authored and GitHub committed May 1, 2020
2 parents 5bceb2b + 8ff10b4 commit 3d3dccf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/upload-lib.js

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

6 changes: 5 additions & 1 deletion src/upload-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ export async function upload(input: string) {
const sarifFiles = fs.readdirSync(input)
.filter(f => f.endsWith(".sarif"))
.map(f => path.resolve(input, f));
if (sarifFiles.length === 0) {
core.setFailed("No SARIF files found to upload in \"" + input + "\".");
return;
}
await uploadFiles(sarifFiles);
} else {
await uploadFiles([input]);
Expand All @@ -134,7 +138,7 @@ async function uploadFiles(sarifFiles: string[]) {
const analysisName = util.getRequiredEnvParam('GITHUB_WORKFLOW');
const startedAt = process.env[sharedEnv.CODEQL_ACTION_STARTED_AT];

core.debug("Uploading sarif files: " + JSON.stringify(sarifFiles));
core.info("Uploading sarif files: " + JSON.stringify(sarifFiles));
let sarifPayload = combineSarifFiles(sarifFiles);
sarifPayload = fingerprints.addFingerprints(sarifPayload);

Expand Down

0 comments on commit 3d3dccf

Please sign in to comment.