Skip to content

Commit

Permalink
Merge pull request #21 from kroese/patch-1
Browse files Browse the repository at this point in the history
Better error handling
  • Loading branch information
mukunku authored Dec 14, 2023
2 parents 78009d2 + 34aabe4 commit ce40750
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,22 @@ async function run() {
if (getRefResponse.status === 200) {
console.log("Tag was found");
exists = 'true';
} else {
core.setFailed("Unknown status was returned: " + getRefResponse.status);
}

} catch(error) {
console.log("Tag was not found");
if (error.status === 404) {
console.log("Tag was not found");
} else {
core.setFailed("Unknown status was returned: " + error.status);
console.error(error);
}
}

core.setOutput('exists', exists);
} catch (error) {
core.setFailed(error.message);
console.error(error);
}
}

Expand Down

0 comments on commit ce40750

Please # to comment.