# Triggering Builds from Local Config Files

**URL:** <https://discuss.circleci.com/t/triggering-builds-from-local-config-files/50051>\
**Category:** Build Environment\
**Tags:** dynamic-config\
**Created:** [December 12, 2023, 4:00pm UTC](https://discuss.circleci.com/t/triggering-builds-from-local-config-files/50051 "2023-12-12T16:00:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RounakDas02](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rounakdas02/32/34661_2.png) [@RounakDas02](https://discuss.circleci.com/u/RounakDas02)\
**Post date:** [December 12, 2023, 4:00pm UTC](https://discuss.circleci.com/t/triggering-builds-from-local-config-files/50051/1 "2023-12-12T16:00:50Z")

</div>

I have been triggering CircleCI jobs from my local config files dynamically.  
The post below has helped me a lot in it.  
@fernfernfern

“I tried to put in the link, but it isn’t allowing me to”

However, recently I am unable to pass any build\_parameters to the config files. Though a curl request triggers the job with the correct `config.yml` , it doesn’t pass any environment variable to it. They are all empty.

This is the curl request that I have used till now :

```auto
curl -X POST -H "Circle-Token: CIRCLE_TOKEN" \
--form "config=@/path_to_config_file/test.yml" \
--form "build_parameters[environment_var_name]=ENVIRONMENT_VALUE" \
https://circleci.com/api/v1.1/project/github/{user_name}/{repo_name}/tree/{branch_name}

```

In `test.yml` , a step of `echo $environment_var_name` outputs an empty string. It should have printed `ENVIRONMENT_VALUE`

Any help is greatly appreciated.

Thank you.

---

<div class="post-metadata">

**Author:** ![rit1010](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rit1010/32/34738_2.png) [@rit1010](https://discuss.circleci.com/u/rit1010)\
**Post date:** [December 12, 2023, 10:17pm UTC](https://discuss.circleci.com/t/triggering-builds-from-local-config-files/50051/2 "2023-12-12T22:17:02Z")

</div>

If you are able to receive “test.yml” as a  
Can you also post your test.yml or at least a shortened version that shows the issue?

In terms of the original post by @fernfernfern you are working from, was it

> [@Run builds on CircleCI using a local config file](https://discuss.circleci.com/t/run-builds-on-circleci-using-a-local-config-file/17355):
>
> Have you ever wanted to try out new changes to your CI configuration without the tedium of pushing new commits and polluting your git history? Here’s a simple technique you can use with CircleCI to quickly try out new iterations of your configuration file. Kicking off builds from your command line using a temporary config file that you can quickly update, test, and iterate. This will keep your git history cleaner, and help you test your CircleCI config faster. We’ll be using curl to instruct th…

Being so old it is not possible to tell how the API was documented back then, but currently the API docs detail this endpoint rather differently.

> **[CircleCI API Reference](https://circleci.com/docs/api/v1/index.html#trigger-a-new-job-with-a-branch)**
>
> The CircleCI API is a full-featured RESTful API that allows you to access all information and trigger all actions in CircleCI.

---

<div class="post-metadata">

**Author:** ![RounakDas02](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rounakdas02/32/34661_2.png) [@RounakDas02](https://discuss.circleci.com/u/RounakDas02)\
**Post date:** [December 13, 2023, 6:48am UTC](https://discuss.circleci.com/t/triggering-builds-from-local-config-files/50051/3 "2023-12-13T06:48:32Z")

</div>

Yes, it is indeed the post.

I won’t be able to post the original test.yml, however, here is the shortened version of it.

```auto
version: 2
jobs:
  build:
    working_directory: ~/code
    docker:
            - image: cimg/python:2.7.16
    resource_class: small
    steps:
      - run:
         name: Running step
         command: |
          echo $environment_var_name
          echo "Echo is working"

```

This one is triggered properly. However, `environment_var_name` is empty.

---

<div class="post-metadata">

**Author:** ![RounakDas02](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rounakdas02/32/34661_2.png) [@RounakDas02](https://discuss.circleci.com/u/RounakDas02)\
**Post date:** [December 14, 2023, 4:29am UTC](https://discuss.circleci.com/t/triggering-builds-from-local-config-files/50051/4 "2023-12-14T04:29:46Z")

</div>

[Update]

CircleCI has pushed a fix for v1.1 API endpoint, and this feature has started working again.

However, a similar feature still is pending from v2.

---

<div class="post-metadata">

**Author:** ![Benny](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/benny/32/31553_2.png) [@Benny](https://discuss.circleci.com/u/Benny)\
**Post date:** [December 14, 2023, 7:49am UTC](https://discuss.circleci.com/t/triggering-builds-from-local-config-files/50051/5 "2023-12-14T07:49:08Z")

</div>

Hi @RounakDas02 .  
We have actually just released a new feature in Closed Preview that might achieve in a very different way what you are trying to do here.  
You can trigger pipelines from VS Code based on your local `config.yml`, and even select which specific jobs you want to run.  
Have a look here and see if it sounds like it’d solve your problem

> [@Announcing a new way to test run your config from VS Code (Closed Preview)](https://discuss.circleci.com/t/announcing-a-new-way-to-test-run-your-config-from-vs-code-closed-preview/50046):
>
> The ability to trigger a pipeline from VS Code with an unversioned config is currently in closed preview . This feature is available on the Free Plan for projects integrated through the GitHub OAuth app , or Bitbucket . To find out which GitHub account type you have, see the [documentation about GitHub OAuth app integration](https://circleci.com/docs/github-integration/). If you are on the Performance of Scale plan, and would like to sign up for the closed preview, you can do so [here](https://docs.google.com/forms/d/1IDOyltcRRN0g5XULRK7qIzmF2Mvb5fnclk9If38_9yI). We’re very excited to introduce a new way of triggering …
