You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
diffci plan crashes when a workflow file is empty or only comments #168
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
fix(research): an empty or comment-only workflow file no longer crash…