Respuesta rápida

Declara `jobs: { build: ... }` (o nombres reales) con al menos un paso; revalida con el linter de CI en el sitio.

CI: jobs faltantes (missing jobs)

En GitHub Actions, `jobs` es obligatorio y no puede estar vacío. En GitLab, normalmente hace falta al menos un job con nombre bajo la raíz.

Causas frecuentes

  • Solo comentarios o claves reservadas sin tareas reales.
  • Borrar jobs por error al combinar.

Cómo arreglarlo

  • Añade un job mínimo (checkout + script).
  • Mira la documentación de la plataforma.

/ci-config-linter

CI Config Missing Jobs means your pipeline definition is structurally incomplete: the workflow file exists, but it does not define any executable job. In GitHub Actions, the jobs key must be present and contain at least one job object. In GitLab CI, the configuration must include at least one job definition such as build or test. This validator helps developers, DevOps engineers, and platform teams quickly identify empty or malformed CI configuration files before they break automation, block merges, or cause pipeline setup failures.

How This Validator Works

This checker inspects your CI configuration for the minimum required execution structure. It verifies that the file is syntactically valid and that it contains at least one runnable job entry. For GitHub Actions, that usually means confirming jobs is a non-empty object. For GitLab CI, it means confirming the config defines at least one job key and is not limited to only global settings, variables, or stages.

  • Checks for a valid top-level CI structure
  • Detects missing or empty job definitions
  • Helps distinguish syntax validity from semantic completeness
  • Supports early detection before pipeline execution

Common Validation Errors

Missing-job errors usually happen when a workflow file is created but not fully populated, or when jobs are accidentally removed during refactoring. Another common case is a config that only includes metadata such as name, on, variables, or stages without any actual job definitions.

  • Empty jobs object in GitHub Actions
  • No job keys defined in GitLab CI
  • Only global configuration present, with no executable steps
  • Indentation or YAML structure issues that hide job entries
  • Accidental deletion of the last job during edits

Where This Validator Is Commonly Used

This validation is commonly used in CI/CD pipelines, repository automation, and pre-merge checks. Teams use it when reviewing workflow files in pull requests, validating template-based pipeline generation, or troubleshooting why a build system refuses to start. It is especially useful in environments where CI files are edited frequently by multiple contributors.

  • GitHub Actions workflow reviews
  • GitLab CI pipeline setup and troubleshooting
  • Pre-commit and pre-merge validation
  • Template-driven CI generation systems
  • DevOps onboarding and configuration audits

Why Validation Matters

CI configuration is part of your delivery infrastructure. A file that parses correctly but contains no jobs can still fail to produce a pipeline, which slows development and makes automation unreliable. Validating the presence of at least one job helps teams catch configuration mistakes early, reduce wasted debugging time, and keep build and deployment workflows predictable.

Technical Details

Different CI systems express jobs in different ways, but the underlying requirement is similar: the configuration must define executable work. In GitHub Actions, jobs is a required top-level mapping whose entries describe one or more jobs. In GitLab CI, jobs are typically top-level keys that define stages, scripts, and execution rules. A file may be valid YAML yet still fail this semantic requirement.

Platform Required Structure Typical Failure
GitHub Actions jobs with at least one job object Empty or missing jobs block
GitLab CI At least one job definition key Only global keys such as stages or variables

This validator focuses on structural completeness, not runtime behavior. It does not confirm whether a job will succeed, whether scripts are valid, or whether secrets and permissions are configured correctly.

Frequently Asked Questions

What does “CI config missing jobs” mean?

It means the CI file does not define any executable job entries. The configuration may exist and may even be syntactically valid YAML, but it lacks the required job structure needed for the pipeline to run. In GitHub Actions, that usually means the jobs section is missing or empty.

Can a CI file be valid YAML but still fail this check?

Yes. YAML syntax validity and CI semantic validity are different. A file can parse correctly as YAML while still being unusable as a workflow because it contains no jobs. This validator checks the CI-specific structure, not just the file format.

What is the minimum requirement for GitHub Actions?

GitHub Actions requires a top-level jobs key with at least one job defined inside it. Each job should include the steps needed to run your automation. Without that structure, the workflow has nothing to execute.

What is the minimum requirement for GitLab CI?

GitLab CI needs at least one job definition, such as build, test, or deploy. A file that only defines stages, variables, or other global settings is not enough to start a pipeline.

Why would a pipeline file have no jobs?

This often happens when a workflow is created as a placeholder, when jobs are removed during refactoring, or when a template is copied without its job block. It can also happen because of indentation mistakes or conditional generation logic that produces an empty file.

Does this validator check job scripts or commands?

No. It focuses on whether the configuration contains at least one job. It does not evaluate shell commands, runner availability, permissions, secret access, or whether the job will pass at runtime.

Can stages alone make a GitLab pipeline valid?

No. Stages define the order or grouping of work, but they do not execute anything by themselves. GitLab CI still needs at least one job that belongs to a stage and includes a script or equivalent execution instruction.

How do I fix a missing-jobs error?

Add at least one valid job definition to the CI file. For GitHub Actions, create a non-empty jobs object with one or more jobs. For GitLab CI, define a job key with the required execution fields. Then re-run validation to confirm the pipeline structure is complete.

Related Validators & Checkers

  • YAML Validator — checks general YAML syntax and structure
  • GitHub Actions Validator — validates workflow file conventions
  • GitLab CI Validator — checks GitLab pipeline configuration structure
  • JSON Validator — useful when CI-related data is generated or stored as JSON
  • XML Validator — relevant for systems that exchange build metadata in XML
  • Syntax Validator — broader format checking for configuration files

Preguntas frecuentes

¿Puede un workflow quedarse vacío sin jobs?
En GitHub Actions, no: `jobs` es requerido con al menos un job.

Relacionado

Todas las herramientas · URL canónica