mirror of
https://github.com/GoTestTools/gotestfmt-action.git
synced 2026-02-08 00:37:27 +00:00
Remove unix specific logging and determine .zip extension on windows
Signed-off-by: Yuri Norwood <106889957+norwd@users.noreply.github.com>
This commit is contained in:
parent
c936969241
commit
b7b7b7013a
1 changed files with 11 additions and 4 deletions
15
index.js
15
index.js
|
|
@ -9,11 +9,17 @@ async function downloadRelease(octokit, os, org, repo, release, token) {
|
|||
repo: repo,
|
||||
release_id: release.id,
|
||||
})
|
||||
tarPostfix = `_${os}_amd64.tar.gz`
|
||||
|
||||
postfix = `_${os}_amd64.tar.gz`
|
||||
|
||||
if (os === "windows") {
|
||||
postfix = `_${os}_amd64.zip`
|
||||
}
|
||||
|
||||
for (let asset of releaseAssets.data) {
|
||||
console.log("Examining release asset " + asset.name + " at " + asset.browser_download_url + " ...")
|
||||
if (asset.name.endsWith(tarPostfix)) {
|
||||
console.log("Found Unix binary named " + asset.name + " at " + asset.browser_download_url + " , attempting download...")
|
||||
if (asset.name.endsWith(postfix)) {
|
||||
console.log("Found binary named " + asset.name + " at " + asset.browser_download_url + " , attempting download...")
|
||||
if (token) {
|
||||
execSync("curl -L -o /tmp/gotestfmt.tar.gz -H \"Authorization: Bearer " + token + "\" " + asset.browser_download_url)
|
||||
} else {
|
||||
|
|
@ -33,7 +39,8 @@ async function downloadRelease(octokit, os, org, repo, release, token) {
|
|||
return
|
||||
}
|
||||
}
|
||||
throw `No release asset matched postfix '${tarPostfix}'.`
|
||||
|
||||
throw `No release asset matched postfix '${postfix}'.`
|
||||
}
|
||||
|
||||
async function downloadGofmt(octokit, version, versionPrefix, os, org, repo, token) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue