Skip to content

Workflow parser never reads GitHub Actions path filters (looks for paths on the job, not under on:) #177

Closed

Description

@FredApps

What went wrong?

The output or a command was wrong or confusing

DiffCI version

core main 40aa308 (src/research/baseline/workflow-parser.ts), reached through analyzeCheckout / diffci plan

Command you ran

// .github/workflows/api.yml
// on:
//   pull_request:
//     paths: ['api/**']
// jobs:
//   test:
//     runs-on: ubuntu-latest
//     steps:
//       - run: npm test
parseRepositoryWorkflows({ packageJson: { scripts: {} }, workflows: [{ path: ".github/workflows/api.yml" }] }, repo)

Environment

Linux, Node 24

Output

[{"path":".github/workflows/api.yml","name":".github/workflows/api.yml","tasks":[{"id":".github/workflows/api::test","name":"test","category":"test","dependsOn":[],"hasTestCommand":true}]}]

pathGlobs is missing. buildGenericTaskRegistry (src/research/baseline/registry.ts:10) then gives the job its category defaults (src/**/*.test.*, tests/**/*, …) instead of the workflow's own api/** filter.

Cause

parseWorkflow (src/research/baseline/workflow-parser.ts:57-58) looks for path filters on the job:

const paths = normalizeStringArray(job["paths"]) ?? normalizeStringArray((job.on as Record<string, unknown>)?.paths) ?? [];
const pathsIgnore = normalizeStringArray(job["paths-ignore"]) ?? [];

GitHub Actions has no job-level paths, paths-ignore or on. Path filters live under the workflow's on.<push|pull_request|pull_request_target>.paths / paths-ignore. So pathGlobs and pathIgnoreGlobs are undefined for every real workflow, and the registry's task.pathGlobs branch never runs.

What you expected

The workflow-level filters are read: pathGlobs = ["api/**"] here.

A workflow also runs for any change when one of its triggers has no paths filter, so in that case it should keep pathGlobs unset. Negated (!) patterns and the glob characters the planner's matcher doesn't handle should also leave it unset (see the matcher issue filed alongside this one), so a filter is never misread.

Activity

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