Skip to content
Latchkey

GitHub Actions "Job depends on unknown job"

A job under needs: references an id that is not declared. The dependency graph cannot be resolved.

What this error means

The workflow is rejected with "Job <X> depends on unknown job <Y>", naming both jobs.

github-actions
The workflow is not valid. .github/workflows/ci.yml (Line: 18): Job 'publish' depends on unknown job 'package'

Common causes

Renamed job not updated everywhere

Renaming a job id without updating its dependents leaves a dangling needs reference.

Case mismatch in the id

Job ids are case-sensitive; Package and package are different.

How to fix it

Update needs to a defined job id

  1. Search the file for the old id and update every needs reference.
  2. Confirm exact case and spelling.
.github/workflows/ci.yml
jobs:
  package: { runs-on: ubuntu-latest, steps: [{ run: ./pkg }] }
  publish: { needs: package, runs-on: ubuntu-latest, steps: [{ run: ./pub }] }

How to prevent it

  • Rename job ids with a find-and-replace across the file.
  • Run actionlint to catch dangling needs.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →