Improve error categorizations

This commit is contained in:
Henry Mercer 2023-12-01 17:54:38 +00:00
parent db40ac46b9
commit 1d367b0bec
24 changed files with 47 additions and 38 deletions

2
lib/actions-util.js generated
View file

@ -177,7 +177,7 @@ async function getRef() {
const hasShaInput = !!shaInput;
// If one of 'ref' or 'sha' are provided, both are required
if ((hasRefInput || hasShaInput) && !(hasRefInput && hasShaInput)) {
throw new Error("Both 'ref' and 'sha' are required if one of them is provided.");
throw new util_1.UserError("Both 'ref' and 'sha' are required if one of them is provided.");
}
const ref = refInput || getRefFromEnv();
const sha = shaInput || (0, util_1.getRequiredEnvParam)("GITHUB_SHA");