mirror of
https://github.com/github/codeql-action.git
synced 2025-12-22 23:30:05 +08:00
Avoid default arguments with historical values
This commit is contained in:
8
lib/upload-lib.js
generated
8
lib/upload-lib.js
generated
@@ -244,7 +244,7 @@ var SARIF_UPLOAD_ENDPOINT;
|
||||
})(SARIF_UPLOAD_ENDPOINT || (exports.SARIF_UPLOAD_ENDPOINT = SARIF_UPLOAD_ENDPOINT = {}));
|
||||
// Upload the given payload.
|
||||
// If the request fails then this will retry a small number of times.
|
||||
async function uploadPayload(payload, repositoryNwo, logger, target = SARIF_UPLOAD_ENDPOINT.CODE_SCANNING_UPLOAD_TARGET) {
|
||||
async function uploadPayload(payload, repositoryNwo, logger, target) {
|
||||
logger.info("Uploading results");
|
||||
// If in test mode we don't want to upload the results
|
||||
if (util.isInTestMode()) {
|
||||
@@ -284,7 +284,7 @@ async function uploadPayload(payload, repositoryNwo, logger, target = SARIF_UPLO
|
||||
}
|
||||
// Recursively walks a directory and returns all SARIF files it finds.
|
||||
// Does not follow symlinks.
|
||||
function findSarifFilesInDir(sarifPath, isSarif = exports.CodeScanningTarget.sarifPredicate) {
|
||||
function findSarifFilesInDir(sarifPath, isSarif) {
|
||||
const sarifFiles = [];
|
||||
const walkSarifFiles = (dir) => {
|
||||
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
||||
@@ -300,7 +300,7 @@ function findSarifFilesInDir(sarifPath, isSarif = exports.CodeScanningTarget.sar
|
||||
walkSarifFiles(sarifPath);
|
||||
return sarifFiles;
|
||||
}
|
||||
function getSarifFilePaths(sarifPath, isSarif = exports.CodeScanningTarget.sarifPredicate) {
|
||||
function getSarifFilePaths(sarifPath, isSarif) {
|
||||
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}`);
|
||||
@@ -435,7 +435,7 @@ exports.CodeQualityTarget = {
|
||||
* Uploads a single SARIF file or a directory of SARIF files depending on what `inputSarifPath` refers
|
||||
* to.
|
||||
*/
|
||||
async function uploadFiles(inputSarifPath, checkoutPath, category, features, logger, uploadTarget = exports.CodeScanningTarget) {
|
||||
async function uploadFiles(inputSarifPath, checkoutPath, category, features, logger, uploadTarget) {
|
||||
const sarifPaths = getSarifFilePaths(inputSarifPath, uploadTarget.sarifPredicate);
|
||||
return uploadSpecifiedFiles(sarifPaths, checkoutPath, category, features, logger, uploadTarget);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user