How to get the compiled version of a config.yml

When CircleCI runs your config.yml it will expand the config to be able to run all of the commands and orbs that have been called, you can view this compiled version of the config using a button on the UI, or throught the API.

Through the UI:

  • Go to your pipelines page

  • Click on the three dots on the right of one of your workflows that have run

  • Click on the Configuration File button

  • On the top right press the compiled button as shown in the screenshot below

Screenshot_2023-01-12_at_10.43.13_am.png

Through the API:

The getPipelineConfigById endpoint will return both the source and compiled configuration.

This can be useful for programmatic analysis, or comparison of the source and compiled configs.

You can use the following example to retrieve the config for a given pipeline:

curl --request GET \
  --url https://circleci.com/api/v2/pipeline/{PIPELINE_ID}/config \
  --header 'Authorization: Basic REPLACE_BASIC_AUTH'

Outcome

You will see that the code has changed to the compiled code and your original code can be found at the bottom as a comment.

This can be used to help identify the code that ran to help debug any issues that you find from commands that are called.

 
 

 

 

Was this article helpful?
1 out of 2 found this helpful

Comments

0 comments

Article is closed for comments.