Skip to content
Latchkey

GitHub Actions "job ... uses ... and also defines steps" in CI

A single job either calls a reusable workflow (uses: at the job level) or runs its own steps:. Mixing them in one job is invalid; the caller job that uses a reusable workflow cannot also list steps, runs-on, or a container.

What this error means

Parsing fails with a message that a job calling a reusable workflow cannot also define steps (or runs-on, container, services). The offending job has both uses: and steps:.

GitHub Actions
Invalid workflow file: .github/workflows/ci.yml#L14
The job "deploy" calls a reusable workflow with "uses" and therefore
cannot have "steps". Remove "steps" or split into a separate job.

Common causes

Steps were added to a calling job

You added a checkout or setup step directly inside the job that has uses:. A calling job runs only the reusable workflow, so it accepts no steps.

runs-on or container set on a calling job

A calling job also rejects runs-on, container, and services; those belong to the jobs inside the reusable workflow.

How to fix it

Split the extra work into its own job

  1. Keep the calling job with only uses: and with:/secrets:.
  2. Move any steps into a separate job.
  3. Wire order with needs: if the step job must run first.
.github/workflows/ci.yml
jobs:
  prep:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
  deploy:
    needs: prep
    uses: ./.github/workflows/deploy.yml

Move runner config into the reusable workflow

Set runs-on and any container on the jobs defined inside the called workflow, not on the calling job.

.github/workflows/deploy.yml
# in deploy.yml
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - run: ./deploy.sh

How to prevent it

  • Treat a calling job as a pure invocation: only uses, with, secrets, needs, if.
  • Put setup steps in a separate job connected by needs.
  • Define runs-on and containers inside the reusable workflow.

Frequently asked questions

What causes "job "uses" and "steps" together"?
You added a checkout or setup step directly inside the job that has uses:. A calling job runs only the reusable workflow, so it accepts no steps.
How do I fix job "uses" and "steps" together?
Split the extra work into its own job

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card