Skip to content

Commit 6242095

Browse files
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
1 parent 373ff33 commit 6242095

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/test.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'build-test'
2+
on: # rebuild any PRs and main branch changes
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
- 'releases/*'
8+
9+
jobs:
10+
test: # make sure the action works on a clean machine without building
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: ./
15+
with:
16+
dep: list
17+
deployer-version: "7.3.0"

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ async function dep() {
9494
break
9595
}
9696
}
97-
if (url === null) {
98-
console.error(`The version "${version}"" does not exist in the "https://deployer.org/manifest.json" file."`)
97+
if (typeof url === 'undefined') {
98+
core.setFailed(`The version "${version}"" does not exist in the "https://deployer.org/manifest.json" file."`)
9999
} else {
100100
console.log(`Downloading "${url}".`)
101101
await $`curl -LO ${url}`

0 commit comments

Comments
 (0)