From 4e9886ad2bf3b89c655a3c6c66a849ba06ae5b1e Mon Sep 17 00:00:00 2001 From: Chris Gavin Date: Fri, 1 May 2020 15:27:32 +0100 Subject: [PATCH] Stop the upload action early if no files will be uploaded. --- lib/upload-lib.js | 1 + src/upload-lib.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 568d2934f..a9abfb900 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -63,6 +63,7 @@ async function upload(input) { .map(f => path.resolve(input, f)); if (sarifFiles.length === 0) { core.setFailed("No SARIF files found to upload in \"" + input + "\"."); + return; } await uploadFiles(sarifFiles); } diff --git a/src/upload-lib.ts b/src/upload-lib.ts index a4959ae36..443a95e86 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -56,6 +56,7 @@ export async function upload(input: string) { .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 {