From d30e97287dce38d0283738d7d1c25064970fc81f Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Wed, 19 Aug 2026 13:43:27 +0800 Subject: [PATCH] Refactor error handling for label creation Removed the creation of a label if a 404 error occurs, now only throws the error. --- .github/workflows/pr.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 06539107bb..a14166e2a7 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -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({