handle errors in dep, correctly catch missing url in version check (#65)

* handle errors in dep, correctly catch missing url in version check

replace console.error with throw to handle dep error failures
in main try/catch to mark job as failed in one place

* add test action, prevent failure on empty options

* fix conflict resolution
This commit is contained in:
Piotr Kwiecinski 2024-03-07 20:15:45 +01:00 committed by GitHub
commit 6242095e72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 2 deletions

View file

@ -94,8 +94,8 @@ async function dep() {
break
}
}
if (url === null) {
console.error(`The version "${version}"" does not exist in the "https://deployer.org/manifest.json" file."`)
if (typeof url === 'undefined') {
core.setFailed(`The version "${version}"" does not exist in the "https://deployer.org/manifest.json" file."`)
} else {
console.log(`Downloading "${url}".`)
await $`curl -LO ${url}`