From 38fa49fb668c2beb27f598ad3dda2aa46b8a10ed Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Tue, 1 Oct 2024 12:33:15 -0700 Subject: [PATCH] chore: update links in github issue templates (#2017) * chore: update links in github issue templates --- .../.github/ISSUE_TEMPLATE/bug_report.yml | 12 ++++++------ .../.github/ISSUE_TEMPLATE/processs_request.md | 5 ++--- .../.github/scripts/close-invalid-link.cjs | 5 ++++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/synthtool/gcp/templates/node_library/.github/ISSUE_TEMPLATE/bug_report.yml b/synthtool/gcp/templates/node_library/.github/ISSUE_TEMPLATE/bug_report.yml index 791734dfc..435800444 100644 --- a/synthtool/gcp/templates/node_library/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/synthtool/gcp/templates/node_library/.github/ISSUE_TEMPLATE/bug_report.yml @@ -24,12 +24,12 @@ body: e.js" required: true - label: "Check our Troubleshooting guide: - https://googlecloudplatform.github.io/google-cloud-node/#/docs/guid\ - es/troubleshooting" + https://github.com/googleapis/google-cloud-node/blob/main/docs/trou\ + bleshooting.md" required: true - label: "Check our FAQ: - https://googlecloudplatform.github.io/google-cloud-node/#/docs/guid\ - es/faq" + https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.\ + md" required: true - label: "Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries\ @@ -55,9 +55,9 @@ body: behavior you are experiencing. If the behavior is the same, it means that you are likely experiencing a bug with the API itself. In that case, please submit an issue to the API team, either by submitting an - issue in its issue tracker https://cloud.google.com/support/docs/issue-trackers, or by + issue in its issue tracker (https://cloud.google.com/support/docs/issue-trackers), or by submitting an issue in its linked tracker in the .repo-metadata.json - file {{ metadata['repo']['issue_tracker'] }} + file {{ metadata['repo']['issue_tracker'] }} validations: required: true - type: input diff --git a/synthtool/gcp/templates/node_library/.github/ISSUE_TEMPLATE/processs_request.md b/synthtool/gcp/templates/node_library/.github/ISSUE_TEMPLATE/processs_request.md index 9f88fc1f3..45682e8f1 100644 --- a/synthtool/gcp/templates/node_library/.github/ISSUE_TEMPLATE/processs_request.md +++ b/synthtool/gcp/templates/node_library/.github/ISSUE_TEMPLATE/processs_request.md @@ -1,5 +1,4 @@ --- 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. - ---- \ No newline at end of file +about: Submit a process request to the library. Process requests are any requests related to library infrastructure, for example CI/CD, publishing, releasing, broken links. +--- diff --git a/synthtool/gcp/templates/node_library/.github/scripts/close-invalid-link.cjs b/synthtool/gcp/templates/node_library/.github/scripts/close-invalid-link.cjs index ba7d51372..d7a3688e7 100644 --- a/synthtool/gcp/templates/node_library/.github/scripts/close-invalid-link.cjs +++ b/synthtool/gcp/templates/node_library/.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?:\/\/g?i?s?t?\.?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); }