mirror of
https://github.com/github/codeql-action
synced 2026-05-27 10:01:44 +03:00
Call lstatSync on sarifPath earlier and check that the path exists then
This commit is contained in:
Generated
+5
-1
@@ -93421,6 +93421,10 @@ async function run() {
|
||||
const sarifPath = getRequiredInput("sarif_file");
|
||||
const checkoutPath = getRequiredInput("checkout_path");
|
||||
const category = getOptionalInput("category");
|
||||
const pathStats = fs15.lstatSync(sarifPath, { throwIfNoEntry: false });
|
||||
if (pathStats === void 0) {
|
||||
throw new ConfigurationError(`Path does not exist: ${sarifPath}.`);
|
||||
}
|
||||
const uploadResult = await uploadFiles(
|
||||
sarifPath,
|
||||
checkoutPath,
|
||||
@@ -93430,7 +93434,7 @@ async function run() {
|
||||
CodeScanning
|
||||
);
|
||||
core13.setOutput("sarif-id", uploadResult.sarifID);
|
||||
if (fs15.lstatSync(sarifPath).isDirectory()) {
|
||||
if (pathStats.isDirectory()) {
|
||||
await findAndUpload(
|
||||
logger,
|
||||
features,
|
||||
|
||||
@@ -129,6 +129,11 @@ async function run() {
|
||||
const sarifPath = actionsUtil.getRequiredInput("sarif_file");
|
||||
const checkoutPath = actionsUtil.getRequiredInput("checkout_path");
|
||||
const category = actionsUtil.getOptionalInput("category");
|
||||
const pathStats = fs.lstatSync(sarifPath, { throwIfNoEntry: false });
|
||||
|
||||
if (pathStats === undefined) {
|
||||
throw new ConfigurationError(`Path does not exist: ${sarifPath}.`);
|
||||
}
|
||||
|
||||
const uploadResult = await upload_lib.uploadFiles(
|
||||
sarifPath,
|
||||
@@ -143,7 +148,7 @@ async function run() {
|
||||
// If there are `.quality.sarif` files in `sarifPath`, then upload those to the code quality service.
|
||||
// Code quality can currently only be enabled on top of security, so we'd currently always expect to
|
||||
// have a directory for the results here.
|
||||
if (fs.lstatSync(sarifPath).isDirectory()) {
|
||||
if (pathStats.isDirectory()) {
|
||||
await findAndUpload(
|
||||
logger,
|
||||
features,
|
||||
|
||||
Reference in New Issue
Block a user