From 10256deeb6cf3b431fa1eff203895fa551990d56 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 5 Nov 2026 20:16:56 +0000 Subject: [PATCH] ci: remove broken Issues workflow and script The Issues workflow calls issues.cjs with no arguments, so every opened or reopened issue fails while destructuring context and github. Delete the workflow and script instead of passing those arguments: the label step adds Difficulty labels that contradict triage, and the title prefix contradicts the documented title convention. Co-Authored-By: Grok 4.7 Co-authored-by: David --- .github/scripts/issues.cjs | 54 ----------------------------------- .github/workflows/issues.yaml | 20 ------------- 2 files changed, 74 deletions(-) delete mode 100644 .github/scripts/issues.cjs delete mode 100644 .github/workflows/issues.yaml diff --git a/.github/scripts/issues.cjs b/.github/scripts/issues.cjs deleted file mode 100644 index 1161514040..0000000000 --- a/.github/scripts/issues.cjs +++ /dev/null @@ -1,54 +0,0 @@ -// @ts-check - -/** @param {import('github-script').AsyncFunctionArguments} args */ -function addPriorityAndDifficulty({ context, github }) { - /** @type {(item: string) => string | null} */ - const extractItem = (item) => { - const items = context.payload.issue?.body?.split('\n\n'); - const labelIndex = items?.findIndex((s) => s.includes(item)); - if (labelIndex === undefined || labelIndex === -1) { - return null; - } - return items?.[labelIndex + 1] ?? null; - }; - const priority = extractItem('Priority'); - const difficulty = extractItem('Estimated Difficulty'); - - const labels = []; - if (priority) { - labels.push(`Priority: ${priority}`); - } - if (difficulty) { - labels.push(`Difficulty: ${difficulty}`); - } - - github.rest.issues.addLabels({ - issue_number: context.issue.number, - labels: labels, - owner: context.repo.owner, - repo: context.repo.repo - }); -} - -/** @param {import('github-script').AsyncFunctionArguments} args */ -function addLabelToTitle({ context, github }) { - const title = context.payload.issue?.title; - const names = ['Bug', 'Feature', 'Enhancement', 'Discussion']; - const kind = context.payload.issue?.labels.find((item) => names.includes(item.name))?.name; - if (!kind) { - console.error('Does not match kind'); - return; - } - github.rest.issues.update({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - title: `[${kind}]: ${title}` - }); -} - -/** @param {import('github-script').AsyncFunctionArguments} args */ -module.exports = (args) => { - addPriorityAndDifficulty(args); - addLabelToTitle(args); -}; diff --git a/.github/workflows/issues.yaml b/.github/workflows/issues.yaml deleted file mode 100644 index cf925c486a..0000000000 --- a/.github/workflows/issues.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Issues -on: - issues: - types: - - reopened - - opened -permissions: - contents: read - issues: write -jobs: - label: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v7 - - name: Run Script - uses: actions/github-script@v9 - with: - script: | - require('./.github/scripts/issues.cjs')()