Skip to main content

How to validate a config that uses private Orbs

Overview

You can use the CircleCI CLI to validate our .circleci/config.yml file. However, when your config references private Orbs, you may encounter the following error:

Error: Cannot find acme-org/[email protected] in the orb registry. Check that the namespace, orb name and version are correct.

This error can be frustrating, but in this article, we will provide a possible solution.

Solution

We can resolve this by making sure we pass the following arguments to circleci config validate :

  • --org-slug : Set this to your organization's slug. For example, `github/acme-org`

  • --token (optional): Point this to your CircleCI user API token if you have not set up your CLI profile

As an example, given the following .circleci/config.yml file:

version: 2.1orbs:
  dummy-private: kelvintaywl/[email protected]:
  my-job:
  docker:
    - image: cimg/base:current
  steps:
    - dummy-private/greetworkflows:
  main:
    jobs:
      - my-job

In this case, my API token can access the kelvintaywl GitHub organization on CircleCI.
My CircleCI user can also use the kelvintaywl/dummy-private Orb.

We can then simply run the following command to validate this config:

$ circleci config validate --org-slug github/kelvintaywl --token $CIRCLE_TOKEN

Additional Resources:

Did this answer your question?