Skip to content

diffci plan crashes when a workflow file is empty or only comments #168

Closed

Description

@FredApps

What went wrong?

DiffCI crashed or printed an error

DiffCI version

0.3.54 (published CLI), and core main 40aa308

Command you ran

git init -q demo && cd demo
mkdir -p src .github/workflows
echo 'export const a = 1;' > src/a.ts
echo '{"name":"x","scripts":{"test":"node --test"}}' > package.json
printf '# disabled for now\n' > .github/workflows/empty.yml   # or an empty file
git add . && git commit -qm 1
echo 'export const a = 2;' > src/a.ts && git commit -qam 2
npx -y -p @diffci.com/[email protected] diffci plan --base HEAD~1

Environment

Ubuntu, Node 24, npm, terminal

Output

{"error":"Cannot read properties of null (reading 'name')","recommendation":"RUN_FULL_CI"}

Cause

parseWorkflow in src/research/baseline/workflow-parser.ts (lines 48-50) catches a YAML syntax error but then reads (doc as Record<string, unknown>).name and .jobs straight away. YAML.parse returns null for an empty or comment-only file, so the property read throws. analyzeCheckout (src/analyze.ts:30) calls parseRepositoryWorkflows, so diffci plan exits 1 for the whole repository whenever any workflow file under .github/workflows/ is empty or commented out.

What you expected

An empty workflow file has no jobs, so it should contribute no tasks, the same as the existing "malformed workflow file" case, and diffci plan should produce a plan.

Activity

  1. added a commit that references this issue on Nov 18, 2026
    26ad96c
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions