Skip to content

Commit

Permalink
chore: update issue templates (#5723)
Browse files Browse the repository at this point in the history
* Update process_request.md

* Update close-invalid-link.cjs
  • Loading branch information
sofisl authored Sep 30, 2024
1 parent 4676845 commit 6d82825
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/process_request.md
Original file line number Diff line number Diff line change
@@ -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.

---
---
5 changes: 4 additions & 1 deletion .github/scripts/close-invalid-link.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6d82825

Please sign in to comment.