Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
fix: Workaround for actions/toolkit#1179
Browse files Browse the repository at this point in the history
  • Loading branch information
rsenden committed Sep 14, 2022
1 parent 1f92811 commit 841b172
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
10 changes: 9 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10291,10 +10291,18 @@ const IS_WINDOWS = process.platform === 'win32';
function getDownloadUrl(version) {
return 'https://tools.fortify.com/scancentral/Fortify_ScanCentral_Client_' + version + '_x64.zip';
}
function addExtension(filePath, extension) {
var newFilePath = filePath;
if (!filePath.endsWith(extension)) {
var newFilePath = newFilePath + extension;
fs.renameSync(filePath, newFilePath);
}
return newFilePath;
}
function downloadAndExtract(url) {
return __awaiter(this, void 0, void 0, function* () {
core.debug("Downloading " + url);
const toolZip = yield tc.downloadTool(url);
const toolZip = addExtension(yield tc.downloadTool(url), ".zip");
core.debug("Extracting " + toolZip);
const extractPath = yield tc.extractZip(toolZip);
return extractPath;
Expand Down
11 changes: 10 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,18 @@ function getDownloadUrl(version: string): string {
return 'https://tools.fortify.com/scancentral/Fortify_ScanCentral_Client_' + version + '_x64.zip';
}

function addExtension(filePath: string, extension: string): string {
var newFilePath = filePath;
if ( !filePath.endsWith(extension) ) {
var newFilePath = newFilePath + extension;
fs.renameSync(filePath, newFilePath);
}
return newFilePath;
}

async function downloadAndExtract(url: string): Promise<string> {
core.debug("Downloading " + url);
const toolZip = await tc.downloadTool(url);
const toolZip = addExtension(await tc.downloadTool(url), ".zip");
core.debug("Extracting " + toolZip);
const extractPath = await tc.extractZip(toolZip);
return extractPath;
Expand Down

0 comments on commit 841b172

Please sign in to comment.