Interview Prep/Git & GitHub/Protection, Hooks and Policy

A required status check never reports and the PR is stuck as "Expected — Waiting for status".

IntermediateScenarioProtection, Hooks and Policy
Answer

Situation read → The workflow did not run, was skipped by path filters, or the check name changed.

What I'd do →

  1. Check the workflow on: triggers and paths: filters. A skipped workflow leaves the check pending forever.
  2. Confirm the required check name matches the job name exactly (matrix jobs add suffixes).
  3. Add a final always-run "gate" job that depends on the others and require only that.
gate:
  if: always()
  needs: [build, test]
  runs-on: ubuntu-latest
  steps:
    - run: test "${{ contains(needs.*.result, 'failure') }}" = "false"

Why → One stable required check decouples protection from job renames and path filtering.

Interview tip → Know that a job skipped because of its own if: reports as success, but a workflow that never triggered reports nothing.

All Git & GitHub questions Roadmap: Git & GitHub

More on Protection, Hooks and Policy