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/foo-private@0.1.0 in the orb registry. Check that the namespace, orb name and version are correct.

 

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.1

orbs:
dummy-private: kelvintaywl/dummy-private@0.1.0

jobs:
my-job:
docker:
- image: cimg/base:current
steps:
- dummy-private/greet

workflows:
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
Was this article helpful?
3 out of 6 found this helpful

Comments

0 comments

Article is closed for comments.