From 6d82825b7324436c00126762703ae6dccba51116 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:23:16 -0700 Subject: [PATCH] chore: update issue templates (#5723) * Update process_request.md * Update close-invalid-link.cjs --- .github/ISSUE_TEMPLATE/process_request.md | 4 ++-- .github/scripts/close-invalid-link.cjs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/process_request.md b/.github/ISSUE_TEMPLATE/process_request.md index 9f88fc1f3b7..93ef0b7449b 100644 --- a/.github/ISSUE_TEMPLATE/process_request.md +++ b/.github/ISSUE_TEMPLATE/process_request.md @@ -1,5 +1,5 @@ --- name: Process Request -about: Submit a process request to the library. Process requests are any requests related to library infrastructure, including CI/CD, publishing, releasing, etc. This issue template should primarily used by internal members. +about: Submit a process request to the library. Process requests are any requests related to library infrastructure, including CI/CD, publishing, releasing, broken links. ---- \ No newline at end of file +--- diff --git a/.github/scripts/close-invalid-link.cjs b/.github/scripts/close-invalid-link.cjs index 26356426269..40e3a7d9c33 100644 --- a/.github/scripts/close-invalid-link.cjs +++ b/.github/scripts/close-invalid-link.cjs @@ -40,9 +40,12 @@ module.exports = async ({ github, context }) => { const isBugTemplate = issue.data.body.includes("Link to the code that reproduces this issue"); if (isBugTemplate) { + console.log(`Issue ${number} is a bug template`) try { - const link = issue.data.body.split("\n")[18].match(/(https?:\/\/(gist\.)?github.com\/.*)/); + const link = issue.data.body.split("\n")[18].match(/(https?:\/\/(gist\.)?github.com\/.*)/)[0]; + console.log(`Issue ${number} contains this link: ${link}`) const isValidLink = (await fetch(link)).ok; + console.log(`Issue ${number} has a ${isValidLink ? "valid" : "invalid"} link`) if (!isValidLink) { await closeIssue(github, owner, repo, number); }