GitLab: a job with needs but no script or trigger
GitLab rejects the configuration with jobs:<job-name> config should contain either a trigger or a needs:pipeline. when a job in .gitlab-ci.yml uses needs but has neither script nor trigger (GitLab docs: debugging CI/CD pipelines, checked November 19, 2026).
Why
Every job must use either script or trigger. needs only says which jobs this one waits for, so it cannot stand alone.
# fails: no script, no trigger package: needs: [build] # works package: needs: [build] script: ./package.sh
To see the error next to the pipeline that failed: Pipelines and Jobs Inbox for GitLab CI, a plugin for JetBrains IDEs, shows under a pipeline that failed before any job ran the messages GitLab gives, such as a configuration error.
Fix
- Add the
scriptthe job should run, or atriggerif the job should start a downstream pipeline. - Check the indentation of the job's keywords:
scriptortriggermay sit at the wrong level. See config contains unknown keys.
GitLab pipelines in IntelliJ IDEA
Pipelines and Jobs Inbox for GitLab CI, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the pipelines of your GitLab projects with their jobs by stage. Under a pipeline that failed before any job ran it shows the messages GitLab gives (errorMessages), such as the configuration error, and it shows YAML errors as GitLab reports them, so you read the error without opening GitLab. After you fix the file, you can run a new pipeline on the branch from the IDE (Pro). Reading is free; retrying, cancelling and running are Pro (US$1.50 a month, with a 30-day trial).
Get it on JetBrains Marketplace
GITLAB is a trademark of GitLab Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by GitLab Inc. or JetBrains.
More: GitLab "config contains unknown keys" · GitLab "config should be an array of hashes" (!reference) · GitLab pipeline failed with no jobs · GitLab "This GitLab CI configuration is invalid" in rules:if