From 41bb4275a3b130601b7db6fefde6bd659786ef99 Mon Sep 17 00:00:00 2001 From: Charis Kyriakou Date: Tue, 22 Aug 2023 13:32:52 +0000 Subject: [PATCH] Only upload results if there are any --- dist/query.js | 14 ++++++++------ src/query.ts | 15 +++++++++------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/dist/query.js b/dist/query.js index dcf5eb1b8..9aac12c25 100644 --- a/dist/query.js +++ b/dist/query.js @@ -60316,12 +60316,14 @@ async function run() { const dbZip = await getDatabase(repo, language); console.log("Running query"); const runQueryResult = await runQuery(codeql, dbZip, repo.nwo, queryPack); - await uploadRepoResult( - controllerRepoId, - variantAnalysisId, - repo, - runQueryResult - ); + if (runQueryResult.resultCount > 0) { + await uploadRepoResult( + controllerRepoId, + variantAnalysisId, + repo, + runQueryResult + ); + } await setVariantAnalysisRepoSucceeded( controllerRepoId, variantAnalysisId, diff --git a/src/query.ts b/src/query.ts index 6a34bd601..b397e7e1a 100644 --- a/src/query.ts +++ b/src/query.ts @@ -87,12 +87,15 @@ async function run(): Promise { console.log("Running query"); const runQueryResult = await runQuery(codeql, dbZip, repo.nwo, queryPack); - await uploadRepoResult( - controllerRepoId, - variantAnalysisId, - repo, - runQueryResult, - ); + if (runQueryResult.resultCount > 0) { + await uploadRepoResult( + controllerRepoId, + variantAnalysisId, + repo, + runQueryResult, + ); + } + await setVariantAnalysisRepoSucceeded( controllerRepoId, variantAnalysisId,