Skip to content

bug: start-issue script GraphQL queries fail on Windows — single-quote escaping #48

Description

@koalashena

Description

scripts/start-issue.ts passes GraphQL queries to gh api graphql using single-quoted multi-line strings via execSync. This works on macOS/Linux bash but fails on Windows because CMD and PowerShell handle single quotes differently.

The query string arrives mangled, producing:

gh: Expected one of SCHEMA, SCALAR, TYPE, ENUM, INPUT, UNION, INTERFACE, actual: UNKNOWN_CHAR ("") at [1, 1]

The branch creation and checkout still succeed, but the GitHub Projects integration (setting status to "In Progress" and Start Date) silently fails.

Affected functions: setProjectStatus() and setProjectDate() in scripts/start-issue.ts:71-198

Steps to reproduce

  1. Clone the repo on Windows
  2. Run pnpm start-issue 4
  3. Branch is created successfully, but two warnings appear:
    Warning: could not update project status — ...
    Warning: could not set Start Date — ...
    

Expected behavior

Project status should be set to "In Progress" and Start Date should be set to today's date, same as on macOS.

Suggested fix

Replace execSync shell-quoted GraphQL calls with stdin-based approach that works cross-platform:

// Instead of:
run(`gh api graphql -f query='...'`);

// Use:
execSync(`gh api graphql`, {
  input: JSON.stringify({ query: `...` }),
  encoding: "utf-8",
});

Or write the query to a temp file and use --input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2:mediumP2 — plannedsize:sSmall — a few hours

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions