diff --git a/dist/attachReleaseAssets/index.js b/dist/attachReleaseAssets/index.js index e6aeb935..d47c595a 100644 --- a/dist/attachReleaseAssets/index.js +++ b/dist/attachReleaseAssets/index.js @@ -23954,7 +23954,7 @@ const Executor_1 = __nccwpck_require__(644); const GithubClient_1 = __nccwpck_require__(8552); const SyftDownloader_1 = __nccwpck_require__(9344); const Util_1 = __nccwpck_require__(2590); -exports.SYFT_BINARY_NAME = "syft" + (process.platform == "win32" ? ".exe" : ""); +exports.SYFT_BINARY_NAME = "syft"; exports.SYFT_VERSION = core.getInput("syft-version") || SyftVersion_1.VERSION; const PRIOR_ARTIFACT_ENV_VAR = "ANCHORE_SBOM_ACTION_PRIOR_ARTIFACT"; const tempDir = fs.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), "sbom-action-")); @@ -24111,7 +24111,11 @@ function downloadSyft() { // Make sure the tool's executable bit is set const syftBinaryPath = `${installPath}_${name}`; yield (0, Executor_1.execute)("sh", [installPath, "-d", "-b", syftBinaryPath, version]); - return path_1.default.join(`${syftBinaryPath}`, `${name}`); + const installedPath = path_1.default.join(`${syftBinaryPath}`, `${name}`); + if (process.platform === "win32") { + return `${installedPath}.exe`; + } + return installedPath; }); } exports.downloadSyft = downloadSyft; @@ -24120,7 +24124,7 @@ exports.downloadSyft = downloadSyft; */ function getSyftCommand() { return __awaiter(this, void 0, void 0, function* () { - const name = exports.SYFT_BINARY_NAME; + const name = exports.SYFT_BINARY_NAME + (process.platform == "win32" ? ".exe" : ""); const version = exports.SYFT_VERSION; const sourceSyft = yield (0, SyftDownloader_1.downloadSyftFromZip)(version); if (sourceSyft) { diff --git a/dist/downloadSyft/index.js b/dist/downloadSyft/index.js index 6e4bd166..8aff83f9 100644 --- a/dist/downloadSyft/index.js +++ b/dist/downloadSyft/index.js @@ -24002,7 +24002,7 @@ const Executor_1 = __nccwpck_require__(644); const GithubClient_1 = __nccwpck_require__(8552); const SyftDownloader_1 = __nccwpck_require__(9344); const Util_1 = __nccwpck_require__(2590); -exports.SYFT_BINARY_NAME = "syft" + (process.platform == "win32" ? ".exe" : ""); +exports.SYFT_BINARY_NAME = "syft"; exports.SYFT_VERSION = core.getInput("syft-version") || SyftVersion_1.VERSION; const PRIOR_ARTIFACT_ENV_VAR = "ANCHORE_SBOM_ACTION_PRIOR_ARTIFACT"; const tempDir = fs.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), "sbom-action-")); @@ -24159,7 +24159,11 @@ function downloadSyft() { // Make sure the tool's executable bit is set const syftBinaryPath = `${installPath}_${name}`; yield (0, Executor_1.execute)("sh", [installPath, "-d", "-b", syftBinaryPath, version]); - return path_1.default.join(`${syftBinaryPath}`, `${name}`); + const installedPath = path_1.default.join(`${syftBinaryPath}`, `${name}`); + if (process.platform === "win32") { + return `${installedPath}.exe`; + } + return installedPath; }); } exports.downloadSyft = downloadSyft; @@ -24168,7 +24172,7 @@ exports.downloadSyft = downloadSyft; */ function getSyftCommand() { return __awaiter(this, void 0, void 0, function* () { - const name = exports.SYFT_BINARY_NAME; + const name = exports.SYFT_BINARY_NAME + (process.platform == "win32" ? ".exe" : ""); const version = exports.SYFT_VERSION; const sourceSyft = yield (0, SyftDownloader_1.downloadSyftFromZip)(version); if (sourceSyft) { diff --git a/dist/runSyftAction/index.js b/dist/runSyftAction/index.js index a152d470..f5d840ff 100644 --- a/dist/runSyftAction/index.js +++ b/dist/runSyftAction/index.js @@ -23954,7 +23954,7 @@ const Executor_1 = __nccwpck_require__(644); const GithubClient_1 = __nccwpck_require__(8552); const SyftDownloader_1 = __nccwpck_require__(9344); const Util_1 = __nccwpck_require__(2590); -exports.SYFT_BINARY_NAME = "syft" + (process.platform == "win32" ? ".exe" : ""); +exports.SYFT_BINARY_NAME = "syft"; exports.SYFT_VERSION = core.getInput("syft-version") || SyftVersion_1.VERSION; const PRIOR_ARTIFACT_ENV_VAR = "ANCHORE_SBOM_ACTION_PRIOR_ARTIFACT"; const tempDir = fs.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), "sbom-action-")); @@ -24111,7 +24111,11 @@ function downloadSyft() { // Make sure the tool's executable bit is set const syftBinaryPath = `${installPath}_${name}`; yield (0, Executor_1.execute)("sh", [installPath, "-d", "-b", syftBinaryPath, version]); - return path_1.default.join(`${syftBinaryPath}`, `${name}`); + const installedPath = path_1.default.join(`${syftBinaryPath}`, `${name}`); + if (process.platform === "win32") { + return `${installedPath}.exe`; + } + return installedPath; }); } exports.downloadSyft = downloadSyft; @@ -24120,7 +24124,7 @@ exports.downloadSyft = downloadSyft; */ function getSyftCommand() { return __awaiter(this, void 0, void 0, function* () { - const name = exports.SYFT_BINARY_NAME; + const name = exports.SYFT_BINARY_NAME + (process.platform == "win32" ? ".exe" : ""); const version = exports.SYFT_VERSION; const sourceSyft = yield (0, SyftDownloader_1.downloadSyftFromZip)(version); if (sourceSyft) { diff --git a/src/github/SyftGithubAction.ts b/src/github/SyftGithubAction.ts index 626405fc..60e15daf 100644 --- a/src/github/SyftGithubAction.ts +++ b/src/github/SyftGithubAction.ts @@ -22,8 +22,7 @@ import { import { downloadSyftFromZip } from "./SyftDownloader"; import { stringify } from "./Util"; -export const SYFT_BINARY_NAME = - "syft" + (process.platform == "win32" ? ".exe" : ""); +export const SYFT_BINARY_NAME = "syft"; export const SYFT_VERSION = core.getInput("syft-version") || VERSION; const PRIOR_ARTIFACT_ENV_VAR = "ANCHORE_SBOM_ACTION_PRIOR_ARTIFACT"; @@ -206,14 +205,18 @@ export async function downloadSyft(): Promise { await execute("sh", [installPath, "-d", "-b", syftBinaryPath, version]); - return path.join(`${syftBinaryPath}`, `${name}`); + const installedPath = path.join(`${syftBinaryPath}`, `${name}`); + if (process.platform === "win32") { + return `${installedPath}.exe`; + } + return installedPath; } /** * Gets the Syft command to run via exec */ export async function getSyftCommand(): Promise { - const name = SYFT_BINARY_NAME; + const name = SYFT_BINARY_NAME + (process.platform == "win32" ? ".exe" : ""); const version = SYFT_VERSION; const sourceSyft = await downloadSyftFromZip(version);