diff --git a/lib/analyze-action-post.js b/lib/analyze-action-post.js index 5398605d4..3a10dad15 100644 --- a/lib/analyze-action-post.js +++ b/lib/analyze-action-post.js @@ -20288,7 +20288,7 @@ var require_dist_node2 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -20296,7 +20296,7 @@ var require_dist_node2 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -20308,14 +20308,14 @@ var require_dist_node2 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -20323,12 +20323,12 @@ var require_dist_node2 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -20343,7 +20343,7 @@ var require_dist_node2 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -21028,7 +21028,7 @@ var require_dist_node6 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -21036,7 +21036,7 @@ var require_dist_node6 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -21048,14 +21048,14 @@ var require_dist_node6 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -21063,12 +21063,12 @@ var require_dist_node6 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -21083,7 +21083,7 @@ var require_dist_node6 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -31821,14 +31821,14 @@ var require_typeGuards = __commonJS({ "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined; + exports2.isDefined = isDefined2; exports2.isObjectWithProperties = isObjectWithProperties; exports2.objectHasProperty = objectHasProperty; - function isDefined(thing) { + function isDefined2(thing) { return typeof thing !== "undefined" && thing !== null; } function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { + if (!isDefined2(thing) || typeof thing !== "object") { return false; } for (const property of properties) { @@ -31839,7 +31839,7 @@ var require_typeGuards = __commonJS({ return true; } function objectHasProperty(thing, property) { - return isDefined(thing) && typeof thing === "object" && property in thing; + return isDefined2(thing) && typeof thing === "object" && property in thing; } } }); @@ -102910,7 +102910,7 @@ var require_dist_node16 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -102918,7 +102918,7 @@ var require_dist_node16 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -102928,12 +102928,12 @@ var require_dist_node16 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push(encodeValue(operator, value2, isKeyOperator(operator) ? key : "")); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -102941,12 +102941,12 @@ var require_dist_node16 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -102961,7 +102961,7 @@ var require_dist_node16 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 9f00316aa..65e6befe3 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -20288,7 +20288,7 @@ var require_dist_node2 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -20296,7 +20296,7 @@ var require_dist_node2 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -20308,14 +20308,14 @@ var require_dist_node2 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -20323,12 +20323,12 @@ var require_dist_node2 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -20343,7 +20343,7 @@ var require_dist_node2 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -21028,7 +21028,7 @@ var require_dist_node6 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -21036,7 +21036,7 @@ var require_dist_node6 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -21048,14 +21048,14 @@ var require_dist_node6 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -21063,12 +21063,12 @@ var require_dist_node6 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -21083,7 +21083,7 @@ var require_dist_node6 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -37670,14 +37670,14 @@ var require_typeGuards = __commonJS({ "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined; + exports2.isDefined = isDefined2; exports2.isObjectWithProperties = isObjectWithProperties; exports2.objectHasProperty = objectHasProperty; - function isDefined(thing) { + function isDefined2(thing) { return typeof thing !== "undefined" && thing !== null; } function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { + if (!isDefined2(thing) || typeof thing !== "object") { return false; } for (const property of properties) { @@ -37688,7 +37688,7 @@ var require_typeGuards = __commonJS({ return true; } function objectHasProperty(thing, property) { - return isDefined(thing) && typeof thing === "object" && property in thing; + return isDefined2(thing) && typeof thing === "object" && property in thing; } } }); diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 931f34583..bfab5e337 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -20288,7 +20288,7 @@ var require_dist_node2 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -20296,7 +20296,7 @@ var require_dist_node2 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -20308,14 +20308,14 @@ var require_dist_node2 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -20323,12 +20323,12 @@ var require_dist_node2 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -20343,7 +20343,7 @@ var require_dist_node2 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -21028,7 +21028,7 @@ var require_dist_node6 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -21036,7 +21036,7 @@ var require_dist_node6 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -21048,14 +21048,14 @@ var require_dist_node6 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -21063,12 +21063,12 @@ var require_dist_node6 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -21083,7 +21083,7 @@ var require_dist_node6 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -31821,14 +31821,14 @@ var require_typeGuards = __commonJS({ "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined; + exports2.isDefined = isDefined2; exports2.isObjectWithProperties = isObjectWithProperties; exports2.objectHasProperty = objectHasProperty; - function isDefined(thing) { + function isDefined2(thing) { return typeof thing !== "undefined" && thing !== null; } function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { + if (!isDefined2(thing) || typeof thing !== "object") { return false; } for (const property of properties) { @@ -31839,7 +31839,7 @@ var require_typeGuards = __commonJS({ return true; } function objectHasProperty(thing, property) { - return isDefined(thing) && typeof thing === "object" && property in thing; + return isDefined2(thing) && typeof thing === "object" && property in thing; } } }); diff --git a/lib/init-action-post.js b/lib/init-action-post.js index 490414bdb..558d20426 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -20288,7 +20288,7 @@ var require_dist_node2 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -20296,7 +20296,7 @@ var require_dist_node2 = __commonJS({ } function getValues(context3, operator, key, modifier) { var value = context3[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -20308,14 +20308,14 @@ var require_dist_node2 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -20323,12 +20323,12 @@ var require_dist_node2 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -20343,7 +20343,7 @@ var require_dist_node2 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -21028,7 +21028,7 @@ var require_dist_node6 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -21036,7 +21036,7 @@ var require_dist_node6 = __commonJS({ } function getValues(context3, operator, key, modifier) { var value = context3[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -21048,14 +21048,14 @@ var require_dist_node6 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -21063,12 +21063,12 @@ var require_dist_node6 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -21083,7 +21083,7 @@ var require_dist_node6 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -37670,14 +37670,14 @@ var require_typeGuards = __commonJS({ "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined; + exports2.isDefined = isDefined2; exports2.isObjectWithProperties = isObjectWithProperties; exports2.objectHasProperty = objectHasProperty; - function isDefined(thing) { + function isDefined2(thing) { return typeof thing !== "undefined" && thing !== null; } function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { + if (!isDefined2(thing) || typeof thing !== "object") { return false; } for (const property of properties) { @@ -37688,7 +37688,7 @@ var require_typeGuards = __commonJS({ return true; } function objectHasProperty(thing, property) { - return isDefined(thing) && typeof thing === "object" && property in thing; + return isDefined2(thing) && typeof thing === "object" && property in thing; } } }); @@ -108759,7 +108759,7 @@ var require_dist_node16 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -108767,7 +108767,7 @@ var require_dist_node16 = __commonJS({ } function getValues(context3, operator, key, modifier) { var value = context3[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -108777,12 +108777,12 @@ var require_dist_node16 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push(encodeValue(operator, value2, isKeyOperator(operator) ? key : "")); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -108790,12 +108790,12 @@ var require_dist_node16 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -108810,7 +108810,7 @@ var require_dist_node16 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { diff --git a/lib/init-action.js b/lib/init-action.js index c7db9fb5f..367504727 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -22196,7 +22196,7 @@ var require_dist_node2 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -22204,7 +22204,7 @@ var require_dist_node2 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -22216,14 +22216,14 @@ var require_dist_node2 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -22231,12 +22231,12 @@ var require_dist_node2 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -22251,7 +22251,7 @@ var require_dist_node2 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -22936,7 +22936,7 @@ var require_dist_node6 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -22944,7 +22944,7 @@ var require_dist_node6 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -22956,14 +22956,14 @@ var require_dist_node6 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -22971,12 +22971,12 @@ var require_dist_node6 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -22991,7 +22991,7 @@ var require_dist_node6 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -37670,14 +37670,14 @@ var require_typeGuards = __commonJS({ "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined; + exports2.isDefined = isDefined2; exports2.isObjectWithProperties = isObjectWithProperties; exports2.objectHasProperty = objectHasProperty; - function isDefined(thing) { + function isDefined2(thing) { return typeof thing !== "undefined" && thing !== null; } function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { + if (!isDefined2(thing) || typeof thing !== "object") { return false; } for (const property of properties) { @@ -37688,7 +37688,7 @@ var require_typeGuards = __commonJS({ return true; } function objectHasProperty(thing, property) { - return isDefined(thing) && typeof thing === "object" && property in thing; + return isDefined2(thing) && typeof thing === "object" && property in thing; } } }); @@ -85778,6 +85778,9 @@ async function asyncSome(array, predicate) { const results = await Promise.all(array.map(predicate)); return results.some((result) => result); } +function isDefined(value) { + return value !== void 0 && value !== null; +} // src/actions-util.ts var pkg = require_package(); @@ -86167,6 +86170,7 @@ async function parseAnalysisKinds(input) { new Set(components.map((component) => component)) ); } +var codeQualityQueries = ["code-quality"]; // src/feature-flags.ts var fs7 = __toESM(require("fs")); @@ -87578,6 +87582,9 @@ function dbLocationOrDefault(dbLocation, tempDir) { function userConfigFromActionPath(tempDir) { return path10.resolve(tempDir, "user-config-from-action.yml"); } +function hasQueryCustomisation(userConfig) { + return isDefined(userConfig["disable-default-queries"]) || isDefined(userConfig.queries) || isDefined(userConfig["query-filters"]); +} async function initConfig(inputs) { const { logger, tempDir } = inputs; if (inputs.configInput) { @@ -87603,6 +87610,20 @@ async function initConfig(inputs) { ); } const config = await initActionState(inputs, userConfig); + if (!isCodeScanningEnabled(config)) { + if (hasQueryCustomisation(config.computedConfig)) { + logger.warning( + "Query customizations will be ignored, because only `code-quality` analysis is enabled." + ); + } + const queries = codeQualityQueries.map((v) => ({ uses: v })); + config.originalUserInput["disable-default-queries"] = true; + config.originalUserInput.queries = queries; + config.originalUserInput["query-filters"] = []; + config.computedConfig["disable-default-queries"] = true; + config.computedConfig.queries = queries; + config.computedConfig["query-filters"] = []; + } const { overlayDatabaseMode, useOverlayDatabaseCaching } = await getOverlayDatabaseMode( inputs.codeql, inputs.repository, @@ -87836,6 +87857,9 @@ function appendExtraQueryExclusions(extraQueryExclusions, cliConfig) { } return augmentedConfig; } +function isCodeScanningEnabled(config) { + return config.analysisKinds.includes("code-scanning" /* CodeScanning */); +} // src/dependency-caching.ts var os2 = __toESM(require("os")); diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index eb4c0b59f..976a012f6 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -20288,7 +20288,7 @@ var require_dist_node2 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -20296,7 +20296,7 @@ var require_dist_node2 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -20308,14 +20308,14 @@ var require_dist_node2 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -20323,12 +20323,12 @@ var require_dist_node2 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -20343,7 +20343,7 @@ var require_dist_node2 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -21028,7 +21028,7 @@ var require_dist_node6 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -21036,7 +21036,7 @@ var require_dist_node6 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -21048,14 +21048,14 @@ var require_dist_node6 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -21063,12 +21063,12 @@ var require_dist_node6 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -21083,7 +21083,7 @@ var require_dist_node6 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -31821,14 +31821,14 @@ var require_typeGuards = __commonJS({ "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined; + exports2.isDefined = isDefined2; exports2.isObjectWithProperties = isObjectWithProperties; exports2.objectHasProperty = objectHasProperty; - function isDefined(thing) { + function isDefined2(thing) { return typeof thing !== "undefined" && thing !== null; } function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { + if (!isDefined2(thing) || typeof thing !== "object") { return false; } for (const property of properties) { @@ -31839,7 +31839,7 @@ var require_typeGuards = __commonJS({ return true; } function objectHasProperty(thing, property) { - return isDefined(thing) && typeof thing === "object" && property in thing; + return isDefined2(thing) && typeof thing === "object" && property in thing; } } }); diff --git a/lib/start-proxy-action-post.js b/lib/start-proxy-action-post.js index 5083c32fd..b85291f99 100644 --- a/lib/start-proxy-action-post.js +++ b/lib/start-proxy-action-post.js @@ -20288,7 +20288,7 @@ var require_dist_node2 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -20296,7 +20296,7 @@ var require_dist_node2 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -20308,14 +20308,14 @@ var require_dist_node2 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -20323,12 +20323,12 @@ var require_dist_node2 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -20343,7 +20343,7 @@ var require_dist_node2 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -21028,7 +21028,7 @@ var require_dist_node6 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -21036,7 +21036,7 @@ var require_dist_node6 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -21048,14 +21048,14 @@ var require_dist_node6 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -21063,12 +21063,12 @@ var require_dist_node6 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -21083,7 +21083,7 @@ var require_dist_node6 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -31821,14 +31821,14 @@ var require_typeGuards = __commonJS({ "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined; + exports2.isDefined = isDefined2; exports2.isObjectWithProperties = isObjectWithProperties; exports2.objectHasProperty = objectHasProperty; - function isDefined(thing) { + function isDefined2(thing) { return typeof thing !== "undefined" && thing !== null; } function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { + if (!isDefined2(thing) || typeof thing !== "object") { return false; } for (const property of properties) { @@ -31839,7 +31839,7 @@ var require_typeGuards = __commonJS({ return true; } function objectHasProperty(thing, property) { - return isDefined(thing) && typeof thing === "object" && property in thing; + return isDefined2(thing) && typeof thing === "object" && property in thing; } } }); @@ -101570,7 +101570,7 @@ var require_dist_node16 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -101578,7 +101578,7 @@ var require_dist_node16 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -101588,12 +101588,12 @@ var require_dist_node16 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push(encodeValue(operator, value2, isKeyOperator(operator) ? key : "")); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -101601,12 +101601,12 @@ var require_dist_node16 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -101621,7 +101621,7 @@ var require_dist_node16 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { diff --git a/lib/upload-lib.js b/lib/upload-lib.js index e13493f1f..b3acaa33d 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -21585,7 +21585,7 @@ var require_dist_node2 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -21593,7 +21593,7 @@ var require_dist_node2 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -21605,14 +21605,14 @@ var require_dist_node2 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -21620,12 +21620,12 @@ var require_dist_node2 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -21640,7 +21640,7 @@ var require_dist_node2 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -22325,7 +22325,7 @@ var require_dist_node6 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -22333,7 +22333,7 @@ var require_dist_node6 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -22345,14 +22345,14 @@ var require_dist_node6 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -22360,12 +22360,12 @@ var require_dist_node6 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -22380,7 +22380,7 @@ var require_dist_node6 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -38967,14 +38967,14 @@ var require_typeGuards = __commonJS({ "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined; + exports2.isDefined = isDefined2; exports2.isObjectWithProperties = isObjectWithProperties; exports2.objectHasProperty = objectHasProperty; - function isDefined(thing) { + function isDefined2(thing) { return typeof thing !== "undefined" && thing !== null; } function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { + if (!isDefined2(thing) || typeof thing !== "object") { return false; } for (const property of properties) { @@ -38985,7 +38985,7 @@ var require_typeGuards = __commonJS({ return true; } function objectHasProperty(thing, property) { - return isDefined(thing) && typeof thing === "object" && property in thing; + return isDefined2(thing) && typeof thing === "object" && property in thing; } } }); diff --git a/lib/upload-sarif-action-post.js b/lib/upload-sarif-action-post.js index a704d103e..503f515c3 100644 --- a/lib/upload-sarif-action-post.js +++ b/lib/upload-sarif-action-post.js @@ -20288,7 +20288,7 @@ var require_dist_node2 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -20296,7 +20296,7 @@ var require_dist_node2 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -20308,14 +20308,14 @@ var require_dist_node2 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -20323,12 +20323,12 @@ var require_dist_node2 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -20343,7 +20343,7 @@ var require_dist_node2 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -21028,7 +21028,7 @@ var require_dist_node6 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -21036,7 +21036,7 @@ var require_dist_node6 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -21048,14 +21048,14 @@ var require_dist_node6 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -21063,12 +21063,12 @@ var require_dist_node6 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -21083,7 +21083,7 @@ var require_dist_node6 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -35658,14 +35658,14 @@ var require_typeGuards = __commonJS({ "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined; + exports2.isDefined = isDefined2; exports2.isObjectWithProperties = isObjectWithProperties; exports2.objectHasProperty = objectHasProperty; - function isDefined(thing) { + function isDefined2(thing) { return typeof thing !== "undefined" && thing !== null; } function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { + if (!isDefined2(thing) || typeof thing !== "object") { return false; } for (const property of properties) { @@ -35676,7 +35676,7 @@ var require_typeGuards = __commonJS({ return true; } function objectHasProperty(thing, property) { - return isDefined(thing) && typeof thing === "object" && property in thing; + return isDefined2(thing) && typeof thing === "object" && property in thing; } } }); @@ -95692,7 +95692,7 @@ var require_dist_node16 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -95700,7 +95700,7 @@ var require_dist_node16 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -95710,12 +95710,12 @@ var require_dist_node16 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push(encodeValue(operator, value2, isKeyOperator(operator) ? key : "")); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -95723,12 +95723,12 @@ var require_dist_node16 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -95743,7 +95743,7 @@ var require_dist_node16 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 980ef151f..6d5a9c8f7 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -20288,7 +20288,7 @@ var require_dist_node2 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -20296,7 +20296,7 @@ var require_dist_node2 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -20308,14 +20308,14 @@ var require_dist_node2 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -20323,12 +20323,12 @@ var require_dist_node2 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -20343,7 +20343,7 @@ var require_dist_node2 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -21028,7 +21028,7 @@ var require_dist_node6 = __commonJS({ return value; } } - function isDefined(value) { + function isDefined2(value) { return value !== void 0 && value !== null; } function isKeyOperator(operator) { @@ -21036,7 +21036,7 @@ var require_dist_node6 = __commonJS({ } function getValues(context2, operator, key, modifier) { var value = context2[key], result = []; - if (isDefined(value) && value !== "") { + if (isDefined2(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); if (modifier && modifier !== "*") { @@ -21048,14 +21048,14 @@ var require_dist_node6 = __commonJS({ } else { if (modifier === "*") { if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { result.push( encodeValue(operator, value2, isKeyOperator(operator) ? key : "") ); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); @@ -21063,12 +21063,12 @@ var require_dist_node6 = __commonJS({ } else { const tmp = []; if (Array.isArray(value)) { - value.filter(isDefined).forEach(function(value2) { + value.filter(isDefined2).forEach(function(value2) { tmp.push(encodeValue(operator, value2)); }); } else { Object.keys(value).forEach(function(k) { - if (isDefined(value[k])) { + if (isDefined2(value[k])) { tmp.push(encodeUnreserved(k)); tmp.push(encodeValue(operator, value[k].toString())); } @@ -21083,7 +21083,7 @@ var require_dist_node6 = __commonJS({ } } else { if (operator === ";") { - if (isDefined(value)) { + if (isDefined2(value)) { result.push(encodeUnreserved(key)); } } else if (value === "" && (operator === "&" || operator === "?")) { @@ -37670,14 +37670,14 @@ var require_typeGuards = __commonJS({ "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined; + exports2.isDefined = isDefined2; exports2.isObjectWithProperties = isObjectWithProperties; exports2.objectHasProperty = objectHasProperty; - function isDefined(thing) { + function isDefined2(thing) { return typeof thing !== "undefined" && thing !== null; } function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { + if (!isDefined2(thing) || typeof thing !== "object") { return false; } for (const property of properties) { @@ -37688,7 +37688,7 @@ var require_typeGuards = __commonJS({ return true; } function objectHasProperty(thing, property) { - return isDefined(thing) && typeof thing === "object" && property in thing; + return isDefined2(thing) && typeof thing === "object" && property in thing; } } }); diff --git a/src/config-utils.test.ts b/src/config-utils.test.ts index 3feb0e96c..d42a5e209 100644 --- a/src/config-utils.test.ts +++ b/src/config-utils.test.ts @@ -197,18 +197,36 @@ test("load code quality config", async (t) => { }), ); - t.deepEqual( - config, - await configUtils.getDefaultConfig( - createTestInitConfigInputs({ - analysisKindsInput: "code-quality", - languagesInput: languages, - tempDir, - codeql, - logger, - }), - ), - ); + const userConfig: configUtils.UserConfig = { + "disable-default-queries": true, + queries: [{ uses: "code-quality" }], + "query-filters": [], + }; + + // And the config we expect it to result in + const expectedConfig: configUtils.Config = { + analysisKinds: [AnalysisKind.CodeQuality], + languages: [KnownLanguage.actions], + buildMode: undefined, + // This gets set because we only have `AnalysisKind.CodeQuality` + originalUserInput: userConfig, + computedConfig: userConfig, + tempDir, + codeQLCmd: codeql.getPath(), + gitHubVersion: githubVersion, + dbLocation: path.resolve(tempDir, "codeql_databases"), + debugMode: false, + debugArtifactName: "", + debugDatabaseName: "", + trapCaches: {}, + trapCacheDownloadTime: 0, + dependencyCachingEnabled: CachingKind.None, + extraQueryExclusions: [], + overlayDatabaseMode: OverlayDatabaseMode.None, + useOverlayDatabaseCaching: false, + }; + + t.deepEqual(config, expectedConfig); }); }); diff --git a/src/config-utils.ts b/src/config-utils.ts index 0fcc87bd6..6e99bb737 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -10,6 +10,7 @@ import { AnalysisConfig, AnalysisKind, CodeQuality, + codeQualityQueries, CodeScanning, parseAnalysisKinds, } from "./analyses"; @@ -34,6 +35,7 @@ import { BuildMode, codeQlVersionAtLeast, cloneObject, + isDefined, } from "./util"; // Property names from the user-supplied config file. @@ -1080,6 +1082,19 @@ function userConfigFromActionPath(tempDir: string): string { return path.resolve(tempDir, "user-config-from-action.yml"); } +/** + * Checks whether the given `UserConfig` contains any query customisations. + * + * @returns Returns `true` if the `UserConfig` customises which queries are run. + */ +function hasQueryCustomisation(userConfig: UserConfig): boolean { + return ( + isDefined(userConfig["disable-default-queries"]) || + isDefined(userConfig.queries) || + isDefined(userConfig["query-filters"]) + ); +} + /** * Load and return the config. * @@ -1116,6 +1131,29 @@ export async function initConfig(inputs: InitConfigInputs): Promise { const config = await initActionState(inputs, userConfig); + // If Code Scanning analysis is disabled, then we initialise the database for Code Quality. + // That entails disabling the default queries and only running quality queries. + if (!isCodeScanningEnabled(config)) { + // Warn if any query customisations are present in the computed configuration. + if (hasQueryCustomisation(config.computedConfig)) { + logger.warning( + "Query customizations will be ignored, because only `code-quality` analysis is enabled.", + ); + } + + const queries = codeQualityQueries.map((v) => ({ uses: v })); + + // Set the query customisation options for Code Quality only analysis. + config.originalUserInput["disable-default-queries"] = true; + config.originalUserInput.queries = queries; + config.originalUserInput["query-filters"] = []; + + // Update the computed configuration for the call to `getOverlayDatabaseMode`. + config.computedConfig["disable-default-queries"] = true; + config.computedConfig.queries = queries; + config.computedConfig["query-filters"] = []; + } + // The choice of overlay database mode depends on the selection of languages // and queries, which in turn depends on the user config and the augmentation // properties. So we need to calculate the overlay database mode after the