CI/CD components | GitLab Docs (original) (raw)

A CI/CD component is a reusable single pipeline configuration unit. Use components to create a small part of a larger pipeline, or even to compose a complete pipeline configuration.

A component can be configured with input parameters for more dynamic behavior.

CI/CD components are similar to the other kinds of configuration added with the include keyword, but have several advantages:

Instead of creating your own components, you can also search for published components that have the functionality you need in the CI/CD Catalog.

For an introduction and hands-on examples, see Efficient DevSecOps workflows with reusable CI/CD components.

For common questions and additional support, see the FAQ: GitLab CI/CD Catalogblog post.

Component project

A component project is a GitLab project with a repository that hosts one or more components. All components in the project are versioned together, with a maximum of 30 components per project.

If a component requires different versioning from other components, the component should be moved to a dedicated component project.

Create a component project

To create a component project, you must:

  1. Create a new project with a README.md file:
    • Ensure the description gives a clear introduction to the component.
    • Optional. After the project is created, you can add a project avatar.
      Components published to the CI/CD catalog use both the description and avatar when displaying the component project’s summary.
  2. Add a YAML configuration file for each component, following the required directory structure. For example:
spec:  
  inputs:  
    stage:  
      default: test  
---  
component-job:  
  script: echo job 1  
  stage: $[[ inputs.stage ]]  

You can use the component immediately, but you might want to consider publishing the component to the CI/CD catalog.

Directory structure

The repository must contain:

Optionally, each component can also have its own README.md file that provides more detailed information, and can be linked from the top-level README.md file. This helps to provide a better overview of your component project and how to use it.

You should also:

For example:

├── templates/  
│   └── my-component.yml  
├── LICENSE.md  
├── README.md  
└── .gitlab-ci.yml  
├── templates/  
│   ├── my-simple-component.yml  
│   └── my-complex-component/  
│       ├── template.yml  
│       ├── Dockerfile  
│       └── test.sh  
├── LICENSE.md  
├── README.md  
└── .gitlab-ci.yml  

In this example:

Use a component

Prerequisites:

If you are a member of a parent group that contains the current group or project:

To add a component to a project’s CI/CD configuration, use the include: componentkeyword. The component reference is formatted as <fully-qualified-domain-name>/<project-path>/<component-name>@<specific-version>, for example:

include:
  - component: $CI_SERVER_FQDN/my-org/security-components/secret-detection@1.0.0
    inputs:
      stage: build

In this example:

Pipeline configuration and component configuration are not processed independently. When a pipeline starts, any included component configuration mergesinto the pipeline’s configuration. If your pipeline and the component both contain configuration with the same name, they can interact in unexpected ways.

For example, two jobs with the same name would merge together into a single job. Similarly, a component using extends for configuration with the same name as a job in your pipeline could extend the wrong configuration. Make sure your pipeline and the component do not share any configuration with the same name, unless you intend to overridethe component’s configuration.

To use GitLab.com components on a GitLab Self-Managed instance, you mustmirror the component project.

If a component requires the use of tokens, passwords, or other sensitive data to function, be sure to audit the component’s source code to verify that the data is only used to perform actions that you expect and authorize. You should also use tokens and secrets with the minimum permissions, access, or scope required to complete the action.

Component versions

In order of highest priority first, the component version can be:

You can use any version supported by the component, but using a version published to the CI/CD catalog is recommended. The version referenced with a commit SHA or branch name might not be published in the CI/CD catalog, but could be used for testing.

Semantic version ranges

When referencing a CI/CD catalog component, you can use a special format to specify the latest semantic version in a range.

This approach offers significant benefits for both consumers and authors of components:

To specify the latest release of:

For example, a component is released in this exact order:

  1. 1.0.0
  2. 1.1.0
  3. 2.0.0
  4. 1.1.1
  5. 1.2.0
  6. 2.1.0
  7. 2.0.1

In this example, referencing the component with:

Pre-release versions are never fetched when referencing a version range. To fetch a pre-release version, specify the full version, for example 1.0.1-rc.

Write a component

This section describes some best practices for creating high quality component projects.

Manage dependencies

While it’s possible for a component to use other components in turn, make sure to carefully select the dependencies. To manage dependencies, you should:

Write a clear README.md

Each component project should have clear and comprehensive documentation. To write a good README.md file:

If a component needs more instructions, add additional documentation in a Markdown file in the component directory and link to it from the main README.md file. For example:

README.md    # with links to the specific docs.md
templates/
├── component-1/
│   ├── template.yml
│   └── docs.md
└── component-2/
    ├── template.yml
    └── docs.md

For an example of a component README.md, see the Deploy to AWS with GitLab CI/CD component’s README.md.

Test the component

Testing CI/CD components as part of the development workflow is strongly recommended and helps ensure consistent behavior.

Test changes in a CI/CD pipeline (like any other project) by creating a .gitlab-ci.ymlin the root directory. Make sure to test both the behavior and potential side-effects of the component. You can use the GitLab API if needed.

For example:

include:
  # include the component located in the current project from the current SHA
  - component: <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi><msub><mi>I</mi><mi>S</mi></msub><mi>E</mi><mi>R</mi><mi>V</mi><mi>E</mi><msub><mi>R</mi><mi>F</mi></msub><mi>Q</mi><mi>D</mi><mi>N</mi><mi mathvariant="normal">/</mi></mrow><annotation encoding="application/x-tex">CI_SERVER_FQDN/</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.05764em;">S</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.00773em;">ER</span><span class="mord mathnormal" style="margin-right:0.22222em;">V</span><span class="mord mathnormal" style="margin-right:0.05764em;">E</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.00773em;">R</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0077em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.13889em;">F</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">Q</span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="mord mathnormal" style="margin-right:0.10903em;">N</span><span class="mord">/</span></span></span></span>CI_PROJECT_PATH/my-component@$CI_COMMIT_SHA
    inputs:
      stage: build

stages: [build, test, release]

# Check if `component job of my-component` is added.
# This example job could also test that the included component works as expected.
# You can inspect data generated by the component, use GitLab API endpoints, or third-party tools.
ensure-job-added:
  stage: test
  image: badouralix/curl-jq
  # Replace "component job of my-component" with the job name in your component.
  script:
    - |
      route="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs"
      count=`curl --silent "$route" | jq 'map(select(.name | contains("component job of my-component"))) | length'`
      if [ "$count" != "1" ]; then
        exit 1; else
        echo "Component Job present"
      fi

# If the pipeline is for a new tag with a semantic version, and all previous jobs succeed,
# create the release.
create-release:
  stage: release
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  script: echo "Creating release $CI_COMMIT_TAG"
  rules:
    - if: $CI_COMMIT_TAG
  release:
    tag_name: $CI_COMMIT_TAG
    description: "Release <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi><msub><mi>I</mi><mi>C</mi></msub><mi>O</mi><mi>M</mi><mi>M</mi><mi>I</mi><msub><mi>T</mi><mi>T</mi></msub><mi>A</mi><mi>G</mi><mi>o</mi><mi>f</mi><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>o</mi><mi>n</mi><mi>e</mi><mi>n</mi><mi>t</mi><mi>s</mi><mi>r</mi><mi>e</mi><mi>p</mi><mi>o</mi><mi>s</mi><mi>i</mi><mi>t</mi><mi>o</mi><mi>r</mi><mi>y</mi></mrow><annotation encoding="application/x-tex">CI_COMMIT_TAG of components repository </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.07153em;">C</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.10903em;">OMM</span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">T</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.13889em;">T</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">A</span><span class="mord mathnormal">G</span><span class="mord mathnormal">o</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mord mathnormal">co</span><span class="mord mathnormal">m</span><span class="mord mathnormal">p</span><span class="mord mathnormal">o</span><span class="mord mathnormal">n</span><span class="mord mathnormal">e</span><span class="mord mathnormal">n</span><span class="mord mathnormal">t</span><span class="mord mathnormal">sre</span><span class="mord mathnormal">p</span><span class="mord mathnormal">os</span><span class="mord mathnormal">i</span><span class="mord mathnormal">t</span><span class="mord mathnormal" style="margin-right:0.03588em;">ory</span></span></span></span>CI_PROJECT_PATH"

After committing and pushing changes, the pipeline tests the component, then creates a release if the earlier jobs pass.

Authentication is necessary if the project is private.

Test a component against sample files

In some cases, components require source files to interact with. For example, a component that builds Go source code likely needs some samples of Go to test against. Alternatively, a component that builds Docker images likely needs some sample Dockerfiles to test against.

You can include sample files like these directly in the component project, to be used during component testing.

You can learn more in examples for testing a component.

Avoid hard-coding instance or project-specific values

When using another component in your component, use $CI_SERVER_FQDNinstead of your instance’s Fully Qualified Domain Name (like gitlab.com).

When accessing the GitLab API in your component, use the $CI_API_V4_URL instead of the full URL and path for your instance (like https://gitlab.com/api/v4).

These predefined variablesensure that your component also works when used on another instance, for example when usinga GitLab.com component on a GitLab Self-Managed instance.

Do not assume API resources are always public

Ensure that the component and its testing pipeline work also on GitLab Self-Managed. While some API resources of public projects on GitLab.com could be accessed via unauthenticated requests on a GitLab Self-Managed instance a component project could be mirrored as private or internal project.

It’s important that an access token can optionally be provided via inputs or variables to authenticate requests on GitLab Self-Managed instances.

Avoid using global keywords

Avoid using global keywords in a component. Using these keywords in a component affects all jobs in a pipeline, including jobs directly defined in the main .gitlab-ci.yml or in other included components.

As an alternative to global keywords:

For example, avoid using the default global keyword:

# Not recommended
default:
  image: ruby:3.0

rspec-1:
  script: bundle exec rspec dir1/

rspec-2:
  script: bundle exec rspec dir2/

Instead, you can:

rspec-1:  
  image: ruby:3.0  
  script: bundle exec rspec dir1/  
rspec-2:  
  image: ruby:3.0  
  script: bundle exec rspec dir2/  
.rspec-image:  
  image: ruby:3.0  
rspec-1:  
  extends:  
    - .rspec-image  
  script: bundle exec rspec dir1/  
rspec-2:  
  extends:  
    - .rspec-image  
  script: bundle exec rspec dir2/  

Replace hardcoded values with inputs

Avoid using hardcoded values in CI/CD components. Hardcoded values might force component users to need to review the component’s internal details and adapt their pipeline to work with the component.

A common keyword with problematic hard-coded values is stage. If a component job’s stage is hardcoded, all pipelines using the component must either define the exact same stage, or overridethe configuration.

The preferred method is to use the input keyword for dynamic component configuration. The component user can specify the exact value they need.

For example, to create a component with stage configuration that can be defined by users:

spec:  
  inputs:  
    stage:  
      default: test  
---  
unit-test:  
  stage: $[[ inputs.stage ]]  
  script: echo unit tests  
integration-test:  
  stage: $[[ inputs.stage ]]  
  script: echo integration tests  
stages: [verify, release]  
include:  
  - component: $CI_SERVER_FQDN/myorg/ruby/test@1.0.0  
    inputs:  
      stage: verify  

Define job names with inputs

Similar to the values for the stage keyword, you should avoid hard-coding job names in CI/CD components. When your component’s users can customize job names, they can prevent conflicts with the existing names in their pipelines. Users could also include a component multiple times with different input options by using different names.

Use inputs to allow your component’s users to define a specific job name, or a prefix for the job name. For example:

spec:
  inputs:
    job-prefix:
      description: "Define a prefix for the job name"
    job-name:
      description: "Alternatively, define the job's name"
    job-stage:
      default: test
---

"$[[ inputs.job-prefix ]]-scan-website":
  stage: $[[ inputs.job-stage ]]
  script:
    - scan-website-1

"$[[ inputs.job-name ]]":
  stage: $[[ inputs.job-stage ]]
  script:
    - scan-website-2

Replace custom CI/CD variables with inputs

When using CI/CD variables in a component, evaluate if the inputs keyword should be used instead. Avoid asking users to define custom variables to configure components when inputs is a better solution.

Inputs are explicitly defined in the component’s spec section, and have better validation than variables. For example, if a required input is not passed to the component, GitLab returns a pipeline error. By contrast, if a variable is not defined, its value is empty, and there is no error.

For example, use inputs instead of variables to configure a scanner’s output format:

spec:  
  inputs:  
    scanner-output:  
      default: json  
---  
my-scanner:  
  script: my-scan --output $[[ inputs.scanner-output ]]  
include:  
  - component: $CI_SERVER_FQDN/path/to/project/my-scanner@1.0.0  
    inputs:  
      scanner-output: yaml  

In other cases, CI/CD variables might still be preferred. For example:

CI/CD Catalog

The CI/CD Catalog is a list of projects with published CI/CD components you can use to extend your CI/CD workflow.

Anyone can create a component project and add it to the CI/CD Catalog, or contribute to an existing project to improve the available components.

For a click-through demo, see the CI/CD Catalog beta Product Tour.

View the CI/CD Catalog

To access the CI/CD Catalog and view the published components that are available to you:

  1. On the left sidebar, select Search or go to.
  2. Select Explore.
  3. Select CI/CD Catalog.

Alternatively, if you are already in the pipeline editorin your project, you can select CI/CD Catalog.

Visibility of components in the CI/CD catalog follows the component source project’svisibility setting. Components with source projects set to:

Publish a component project

To publish a component project in the CI/CD catalog, you must:

  1. Set the project as a catalog project.
  2. Publish a new release.

Set a component project as a catalog project

To make published versions of a component project visible in the CI/CD catalog, you must set the project as a catalog project.

Prerequisites:

To set the project as a catalog project:

  1. On the left sidebar, select Search or go to and find your project.
  2. Select Settings > General.
  3. Expand Visibility, project features, permissions.
  4. Turn on the CI/CD Catalog project toggle.

The project only becomes findable in the catalog after you publish a new release.

To use automation to enable this setting, you can use the mutationcatalogresourcescreateGraphQL endpoint. Issue 463043proposes to expose this in the REST API as well.

Publish a new release

CI/CD components can be used without being listed in the CI/CD catalog. However, publishing a component’s releases in the catalog makes it discoverable to other users.

Prerequisites:

To publish a new version of the component to the catalog:

  1. Add a job to the project’s .gitlab-ci.yml file that uses the releasekeyword to create the new release when a tag is created. You should configure the tag pipeline to test the components before running the release job. For example:
create-release:  
  stage: release  
  image: registry.gitlab.com/gitlab-org/release-cli:latest  
  script: echo "Creating release $CI_COMMIT_TAG"  
  rules:  
    - if: $CI_COMMIT_TAG  
  release:  
    tag_name: $CI_COMMIT_TAG  
    description: "Release <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi><msub><mi>I</mi><mi>C</mi></msub><mi>O</mi><mi>M</mi><mi>M</mi><mi>I</mi><msub><mi>T</mi><mi>T</mi></msub><mi>A</mi><mi>G</mi><mi>o</mi><mi>f</mi><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>o</mi><mi>n</mi><mi>e</mi><mi>n</mi><mi>t</mi><mi>s</mi><mi>i</mi><mi>n</mi></mrow><annotation encoding="application/x-tex">CI_COMMIT_TAG of components in </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.07153em;">C</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.10903em;">OMM</span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">T</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.1389em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.13889em;">T</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal">A</span><span class="mord mathnormal">G</span><span class="mord mathnormal">o</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mord mathnormal">co</span><span class="mord mathnormal">m</span><span class="mord mathnormal">p</span><span class="mord mathnormal">o</span><span class="mord mathnormal">n</span><span class="mord mathnormal">e</span><span class="mord mathnormal">n</span><span class="mord mathnormal">t</span><span class="mord mathnormal">s</span><span class="mord mathnormal">in</span></span></span></span>CI_PROJECT_PATH"  
  1. Create a new tag for the release, which should trigger a tag pipeline that contains the job responsible for creating the release. The tag must use semantic versioning.

After the release job completes successfully, the release is created and the new version is published to the CI/CD catalog.

Semantic versioning

When tagging and releasing new versions of components to the Catalog, you must use semantic versioning. Semantic versioning is the standard for communicating that a change is a major, minor, patch, or other kind of change.

For example, 1.0.0, 2.3.4, and 1.0.0-alpha are all valid semantic versions.

Unpublish a component project

To remove a component project from the catalog, turn off the CI/CD Catalog resourcetoggle in the project settings.

This action destroys the metadata about the component project and its versions published in the catalog. The project and its repository still exist, but are not visible in the catalog.

To publish the component project in the catalog again, you need to publish a new release.

Verified component creators

Some CI/CD components are badged with an icon to show that the component was created and is maintained by users verified by GitLab or the instance administrator:

Set a component as maintained by a verified creator

A GitLab administrator can set a CI/CD component as created and maintained by a verified creator:

  1. Open GraphiQL in the instance with your administrator account, for example at: https://gitlab.example.com/-/graphql-explorer.
  2. Run this query, replacing root-level-group with the root namespace of the component to verify:
mutation {  
  verifiedNamespaceCreate(input: { namespacePath: "root-level-group",  
    verificationLevel: VERIFIED_CREATOR_SELF_MANAGED  
    }) {  
    errors  
  }  
}  

After the query completes, all components in projects in the root namespace are verified. The Verified creator badge displays next to the component names in the CI/CD catalog.

To remove the badge from a component, repeat the query with UNVERIFIED for verificationLevel.

Convert a CI/CD template to a component

Any existing CI/CD template that you use in projects by using the include: syntax can be converted to a CI/CD component:

  1. Decide if you want the component to be grouped with other components as part of an existing component project, or create a new component project.
  2. Create a YAML file in the component project according to the directory structure.
  3. Copy the content of the original template YAML file into the new component YAML file.
  4. Refactor the new component’s configuration to:
  5. Leverage the .gitlab-ci.yml in the components repository to test changes to the component.
  6. Tag and release the component.

You can learn more by following a practical example for migrating the Go CI/CD template to CI/CD component.

The CI/CD catalog of a fresh install of a GitLab instance starts with no published CI/CD components. To populate your instance’s catalog, you can:

To mirror a GitLab.com component in your GitLab Self-Managed instance:

  1. Make sure that network outbound requests are allowed for gitlab.com.
  2. Create a group to host the component projects (recommended group: components).
  3. Create a mirror of the component project in the new group.
  4. Write a project descriptionfor the component project mirror because mirroring repositories does not copy the description.
  5. Set the self-hosted component project as a catalog resource.
  6. Publish a new release in the self-hosted component project byrunning a pipeline for a tag (usually the latest tag).

CI/CD component security best practices

For component users

As anyone can publish components to the catalog, you should carefully review components before using them in your project. Use of GitLab CI/CD components is at your own risk and GitLab cannot guarantee the security of third-party components.

When using third-party CI/CD components, consider the following security best practices:

For component maintainers

To maintain secure and trustworthy CI/CD components and ensure the integrity of the pipeline configuration you deliver to users, follow these best practices:

Troubleshooting

content not found message

You might receive an error message similar to the following when using the ~latestversion qualifier to reference a component hosted by a catalog project:

This GitLab CI configuration is invalid: Component 'gitlab.com/my-namespace/my-project/my-component@~latest' - content not found

The ~latest behavior was updatedin GitLab 16.10. It now refers to the latest semantic version of the catalog resource. To resolve this issue, create a new release.

Error: Build component error: Spec must be a valid json schema

If a component has invalid formatting, you might not be able to create a release and could receive an error like Build component error: Spec must be a valid json schema.

This error can be caused by an empty spec:inputs section. If your configuration does not use any inputs, you can make the spec section empty instead. For example:

spec:
---

my-component:
  script: echo