From 241f99bacff7d56c06b83b6483636d472a9f91bf Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 28 May 2026 00:38:52 +0530 Subject: [PATCH 1/2] chore: Auto-close issues with only "Broken link" in title Add a GitHub Action that closes low-effort issues using the default pre-filled title and prompts reporters to include the failing URL and details. Co-authored-by: Cursor --- .../workflows/close-broken-link-issues.yml | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/close-broken-link-issues.yml diff --git a/.github/workflows/close-broken-link-issues.yml b/.github/workflows/close-broken-link-issues.yml new file mode 100644 index 00000000..31dec9f2 --- /dev/null +++ b/.github/workflows/close-broken-link-issues.yml @@ -0,0 +1,54 @@ +name: Close broken link issues + +on: + issues: + types: [opened, edited] + +permissions: + issues: write + +jobs: + close-broken-link-issues: + if: github.event.issue.state == 'open' + runs-on: ubuntu-latest + steps: + - name: Close issues with only "Broken link" in the title + uses: actions/github-script@v7 + with: + script: | + const title = context.payload.issue.title.trim(); + const isBrokenLinkOnlyTitle = /^broken link\.?$/i.test(title); + + if (!isBrokenLinkOnlyTitle) { + return; + } + + const { owner, repo } = context.repo; + const issueNumber = context.payload.issue.number; + const newIssueUrl = `https://github.com/${owner}/${repo}/issues/new?assignees=&labels=bug&template=bug_report.md&title=Broken%20link`; + + const commentBody = [ + `@${context.payload.issue.user.login} This issue was automatically closed because the title only contains "Broken link" without additional details.`, + '', + 'When reporting a broken link, please include:', + '- The full URL that failed to load', + '- What you expected to happen', + '- Any error messages you saw', + '', + `You can [open a new issue](${newIssueUrl}) with this information.` + ].join('\n'); + + await github.rest.issues.createComment({ + owner, + repo, + issue_number: issueNumber, + body: commentBody + }); + + await github.rest.issues.update({ + owner, + repo, + issue_number: issueNumber, + state: 'closed', + state_reason: 'not_planned' + }); From 7cd24ddcb3df400678d9384f2396ce4be3706c98 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 28 May 2026 00:41:27 +0530 Subject: [PATCH 2/2] chore: Clarify live editor vs Mermaid syntax issues in auto-close comment Direct syntax error reports to mermaid-js/mermaid and limit this repo to live editor bugs. Co-authored-by: Cursor --- .github/workflows/close-broken-link-issues.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/close-broken-link-issues.yml b/.github/workflows/close-broken-link-issues.yml index 31dec9f2..486aa7f0 100644 --- a/.github/workflows/close-broken-link-issues.yml +++ b/.github/workflows/close-broken-link-issues.yml @@ -27,15 +27,21 @@ jobs: const issueNumber = context.payload.issue.number; const newIssueUrl = `https://github.com/${owner}/${repo}/issues/new?assignees=&labels=bug&template=bug_report.md&title=Broken%20link`; + const mermaidIssuesUrl = 'https://github.com/mermaid-js/mermaid/issues/new'; + const commentBody = [ `@${context.payload.issue.user.login} This issue was automatically closed because the title only contains "Broken link" without additional details.`, '', - 'When reporting a broken link, please include:', + '**Please only open issues here if something is broken in the live editor itself** (e.g. a link fails to load, the editor UI misbehaves, or a feature of mermaid.live does not work).', + '', + '**Do not open issues here for syntax errors or invalid Mermaid diagram code.** Those belong in the main Mermaid repository: [mermaid-js/mermaid](https://github.com/mermaid-js/mermaid/issues/new).', + '', + 'If you are reporting a live editor bug, please include:', '- The full URL that failed to load', '- What you expected to happen', '- Any error messages you saw', '', - `You can [open a new issue](${newIssueUrl}) with this information.` + `You can [open a new issue in this repo](${newIssueUrl}) with this information, or report diagram syntax issues in the [Mermaid repo](${mermaidIssuesUrl}).` ].join('\n'); await github.rest.issues.createComment({