mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-12 12:13:57 +00:00
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:
1 parent
489d4d4255
commit
d30e97287d
1 file changed
+1
-11
@@ -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({
|
||||
|
||||
Reference in new issue
Block a user