Skip to content

Issues workflow fails on every opened issue because issues.cjs is called without its arguments #1786

Closed

Description

@joshunrau

The "Issues" workflow fails on every issue that is opened or reopened. The workflow calls require('./.github/scripts/issues.cjs')() with no arguments. The module's default export forwards its args parameter to addPriorityAndDifficulty({ context, github }), so the destructure throws TypeError: Cannot destructure property 'context' of 'undefined' before any API call. All 195 runs GitHub still retains failed, from 2025-09-16 to today. The call has had no arguments since the script was moved out of the workflow in Feb 2024. Every new issue therefore adds a red run to the Actions tab and sends a failure notification. A plain fix would also do the wrong thing. The issue templates no longer contain the Priority and Estimated Difficulty sections the script parses, so it would call addLabels with an empty list. .agents/skills/opening-issues/SKILL.md says titles carry no [Bug]:-style prefix, yet the script would add one to every title, and on reopened it would add a second ([Bug]: [Bug]: …).

Where

.github/workflows/issues.yaml:16-20:

- name: Run Script
  uses: actions/github-script@v9
  with:
    script: |
      require('./.github/scripts/issues.cjs')()

.github/scripts/issues.cjs:4 and :51-54:

function addPriorityAndDifficulty({ context, github }) {
// ...
module.exports = (args) => {
  addPriorityAndDifficulty(args);
  addLabelToTitle(args);
};

Reproduce

  1. Open any issue on the repository.
  2. Open the triggered "Issues" run (gh run list --workflow=Issues --limit 1) and read its log.

Actual: ##[error]Unhandled error: TypeError: Cannot destructure property 'context' of 'undefined' as it is undefined. (for example, run 37676175978).
Expected: either the workflow does something useful and succeeds, or it does not exist.

Tests

No unit or Playwright test can run a GitHub workflow. Verify the fix by opening and then reopening a test issue, and confirming that no "Issues" run fails and that the title is unchanged.

Suggested fix

Delete .github/workflows/issues.yaml and .github/scripts/issues.cjs. The templates no longer feed the label step, and the title step contradicts the documented title convention. If automatic labelling is still wanted, reimplement it against the current templates. Pass { context, github } from the workflow, await both API calls, and skip addLabels when there is nothing to add.

Activity

  1. added
    BugType: existing behavior is wrong
    Priority: LowNice to have, cosmetic or speculative
    Difficulty: LowIsolated change, about 2 hours or less
    Area: InfrastructureDeployment, Docker, CI, logging, CLIs, build and test tooling
    Good First IssueWell-scoped, low-risk and self-contained; a good entry point for a new contributor
    on Oct 7, 2026
  2. joshunrau commented on Oct 26, 2026

    @joshunrau
    CollaboratorAuthor

    Still reproduces on main (d86740e). GitHub now retains 317 runs of this workflow, and every one failed. The latest is run 40239906147, opened for #1824 on 2026-10-25.

    Corrections

    • Two templates still feed the label step. .github/ISSUE_TEMPLATE/enhancement.yaml:32/:43 and .github/ISSUE_TEMPLATE/feature.yaml:16/:27 still have the Estimated Difficulty and Priority dropdowns. Only bug.yaml lost its Priority dropdown, in 5a0ceb2 (2025-07-23). It never had Estimated Difficulty, and discussion.yml has neither. Timezone (GMT, EST) to be selected by group manager so dates can be displayed accurately #1604 was filed from the Enhancement template with Medium / High and carries only Enhancement. A working script would have labelled it Priority: High and Difficulty: Medium.
    • The label list is empty only when the body never mentions either word. extractItem (.github/scripts/issues.cjs:6-13) returns the paragraph after the first \n\n-separated paragraph that contains the word anywhere. Run with { context, github } against this issue's own body, the script calls addLabels with Priority: ## Where and Difficulty: ## Where. An unanswered optional Difficulty dropdown renders as _No response_, which becomes Difficulty: _No response_.

    Recommendation

    Delete both files and do not reimplement the label step. Triage replaces the reporter's estimate most of the time. Of the 13 open, triaged issues whose body answers Estimated Difficulty, 10 carry a different Difficulty label. Examples: #1546 (Medium, labelled Very High), #1412 (Low, labelled High), #1559 and #1537 (Low, labelled Medium). A step that only adds labels would leave two Difficulty labels on those until the triager removed one, which breaks the one-Difficulty rule in .agents/skills/opening-issues/SKILL.md. Issues filed through that skill already set their labels with gh issue create --label.

    gh workflow disable Issues stops the failure notifications until the deletion merges.

    Plan

    • One ci: commit with no scope. .github is not a workspace, and commitlint.config.ts accepts only workspace names as scopes.
    • Nothing else needs to change. The .github/scripts/*.cjs globs at knip.ts:9 and :18 still match release.cjs. .github/scripts is outside the coverage include (vitest.config.ts:25). No AGENTS.md or playbook mentions this workflow.
    • ci: release from release branches and keep latest on tagged releases #1822 lists release.cjs and publish-npm.cjs by name in the tsconfig.json include, in lint:root and in the coverage include, so the deletion does not conflict with it. ci: release from release branches and keep latest on tagged releases #1822 also drops the import('github-script') JSDoc type from release.cjs (still at release.cjs:15 on main), which leaves issues.cjs as its last user. Whichever of the two lands second should remove 'github-script' and its comment from knip.ts:20-21. Otherwise pnpm knip reports an unused ignoreDependencies entry.

    Triage note written with Claude Code. Code references point at main @ d86740e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: InfrastructureDeployment, Docker, CI, logging, CLIs, build and test toolingBugType: existing behavior is wrongDifficulty: LowIsolated change, about 2 hours or lessGood First IssueWell-scoped, low-risk and self-contained; a good entry point for a new contributorPriority: LowNice to have, cosmetic or speculative

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions