Refactor error handling for label creation

Removed the creation of a label if a 404 error occurs, now only throws the error.
This commit is contained in:
William Harrison authored and GitHub committed 2026-08-19 13:43:27 +08:00
1 parent 489d4d4255
commit d30e97287d
1 file changed
+1 -11
+1 -11
View File
@@ -135,17 +135,7 @@ jobs:
name: label
});
} catch (error) {
if (error.status === 404) {
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: label,
color: "D93F0B",
description: "Your PR template is not complete. (e.g. missing the requirements form, missing website preview)"
});
} else {
throw error;
}
throw error;
}
const labels = await github.rest.issues.listLabelsOnIssue({