mirror of
https://github.com/github/codeql-action.git
synced 2026-10-30 17:39:50 +00:00
Fix getSarifFilePaths not using right filter
This commit is contained in:
6
lib/upload-lib.js
generated
6
lib/upload-lib.js
generated
@@ -300,14 +300,14 @@ function findSarifFilesInDir(sarifPath, isSarif = defaultIsSarif) {
|
||||
walkSarifFiles(sarifPath);
|
||||
return sarifFiles;
|
||||
}
|
||||
function getSarifFilePaths(sarifPath) {
|
||||
function getSarifFilePaths(sarifPath, isSarif = defaultIsSarif) {
|
||||
if (!fs.existsSync(sarifPath)) {
|
||||
// This is always a configuration error, even for first-party runs.
|
||||
throw new util_1.ConfigurationError(`Path does not exist: ${sarifPath}`);
|
||||
}
|
||||
let sarifFiles;
|
||||
if (fs.lstatSync(sarifPath).isDirectory()) {
|
||||
sarifFiles = findSarifFilesInDir(sarifPath);
|
||||
sarifFiles = findSarifFilesInDir(sarifPath, isSarif);
|
||||
if (sarifFiles.length === 0) {
|
||||
// This is always a configuration error, even for first-party runs.
|
||||
throw new util_1.ConfigurationError(`No SARIF files found to upload in "${sarifPath}".`);
|
||||
@@ -434,7 +434,7 @@ exports.CodeQualityTarget = {
|
||||
* to.
|
||||
*/
|
||||
async function uploadFiles(inputSarifPath, checkoutPath, category, features, logger, uploadTarget = exports.CodeScanningTarget) {
|
||||
const sarifPaths = getSarifFilePaths(inputSarifPath);
|
||||
const sarifPaths = getSarifFilePaths(inputSarifPath, uploadTarget.sarifFilter);
|
||||
logger.startGroup(`Uploading ${uploadTarget.name} results`);
|
||||
logger.info(`Processing sarif files: ${JSON.stringify(sarifPaths)}`);
|
||||
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user