More testing

This commit is contained in:
Janos 2021-07-28 08:58:33 +02:00
parent cd87a7e4b4
commit 9a42bf633e
No known key found for this signature in database
GPG key ID: 465EF45E51CBA2BA

View file

@ -63,10 +63,12 @@ async function downloadGofmt(octokit, version, versionPrefix, org, repo) {
} }
} }
} }
console.log("Failed to find a release matching the criteria.")
throw "Failed to find a release matching the criteria." throw "Failed to find a release matching the criteria."
} }
try { async function main() {
try {
// versionPrefix is the prefix of the version gotestfmt-action supports. // versionPrefix is the prefix of the version gotestfmt-action supports.
const versionPrefix = "v1." const versionPrefix = "v1."
const token = core.getInput('token'); const token = core.getInput('token');
@ -76,11 +78,12 @@ try {
const octokit = new Octokit({ const octokit = new Octokit({
auth: token, auth: token,
}) })
downloadGofmt(octokit, version, versionPrefix, org, repo).then(function () { await downloadGofmt(octokit, version, versionPrefix, org, repo)
console.log("Download successful.") console.log("Setup complete.")
}).catch(reason => function() { } catch (error) {
core.setFailed(reason); console.log("Setup failed.")
}) core.setFailed(error);
} catch (error) { }
core.setFailed(error.message);
} }
main()