Interview Prep/GitHub Actions/Speed, Caching & Cost

Every PR runs a 10-minute CodeQL scan for a docs change. Fix it.

BeginnerScenarioSpeed, Caching & Cost
Answer

Situation read → Missing path filters on a non-required analysis workflow.

What I'd do →

  1. Exclude docs from the trigger:
    on:
      pull_request:
        paths-ignore: ["docs/**", "**/*.md"]
    
  2. If it is a required check, instead do job-level filtering so a check is still reported.

Why → Workflow-level filters are fine for non-required workflows and save the most.

Interview tip → Always ask "is it required?" before adding workflow-level path filters.

All GitHub Actions questions Roadmap: GitHub Actions

More on Speed, Caching & Cost