# ENV type in orbs

**URL:** <https://discuss.circleci.com/t/env-type-in-orbs/27424>\
**Category:** Orbs\
**Tags:** envars\
**Created:** [January 3, 2019, 5:05pm UTC](https://discuss.circleci.com/t/env-type-in-orbs/27424 "2019-01-03T17:05:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaumann](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jaumann/32/21032_2.png) [@jaumann](https://discuss.circleci.com/u/jaumann)\
**Post date:** [January 3, 2019, 5:05pm UTC](https://discuss.circleci.com/t/env-type-in-orbs/27424/1 "2019-01-03T17:05:53Z")

</div>

I came across an issue while attempting to use the orb iynere/compare-url@0.3.1([https://circleci.com/orbs/registry/orb/iynere/compare-url](https://circleci.com/orbs/registry/orb/iynere/compare-url)) that I was curious about the right way to fix.

The orb uses a parameter `circle-token` of type `env_var_name`. This prohibits it from being cast as a string, meaning you can’t set it to `$CIRCLE_TOKEN` and instead should set it to `CIRCLE_TOKEN`. But the problem here is that when its referenced from inside a command ([like here](https://github.com/jaumann/compare-url-orb/blob/master/src/commands/reconstruct.yml#L45)) it replaces it as if it’s a string (`CIRCLE_TOKEN` instead of `$CIRCLE_TOKEN`).

Is this the expected behavior? I would assume that since it’s the env\_var\_name type, we could assume it is output as a reference to an ENV variable. Obviously a solution is to just put “$” in front of the `<<parameters.circle-token>>`, but what is the point of that specific type in that case? Thanks!

---

<div class="post-metadata">

**Author:** ![rose](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rose/32/7816_2.png) [@rose](https://discuss.circleci.com/u/rose)\
**Post date:** [January 3, 2019, 5:18pm UTC](https://discuss.circleci.com/t/env-type-in-orbs/27424/2 "2019-01-03T17:18:34Z")

</div>

Hi @jaumann, I recently refactored the orb to use the `env_var_name` parameter type, so I think what you’ve found is just a little bug that I missed! And didn’t notice, since I use it mostly with open-source projects where the token is not required for API calls.

I’ll fix this quick, and in the future, feel free to file issues like this here:

> **[iynere/compare-url-orb](https://github.com/iynere/compare-url-orb/issues)**
>
> CircleCI's 2.1 config processing preview disables the CIRCLE\_COMPARE\_URL environment variable, useful when working with monorepo projects. This orb manually recreates (and improves!) it. - iyne...

---

<div class="post-metadata">

**Author:** ![jaumann](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jaumann/32/21032_2.png) [@jaumann](https://discuss.circleci.com/u/jaumann)\
**Post date:** [January 3, 2019, 5:20pm UTC](https://discuss.circleci.com/t/env-type-in-orbs/27424/3 "2019-01-03T17:20:32Z")

</div>

Oh no worries. I was going to submit a PR but I wasn’t sure if it was an issue with the env\_var\_name type, or with the template. I mentioned it in the issue ([https://github.com/iynere/compare-url-orb/issues/11](https://github.com/iynere/compare-url-orb/issues/11)), but I wasn’t sure the right way to go. Thanks for the awesome support!

---

<div class="post-metadata">

**Author:** ![rose](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rose/32/7816_2.png) [@rose](https://discuss.circleci.com/u/rose)\
**Post date:** [January 3, 2019, 5:24pm UTC](https://discuss.circleci.com/t/env-type-in-orbs/27424/4 "2019-01-03T17:24:38Z")

</div>

Patched! Closing this thread for now. Stoked that folks are using my orb!

---

<div class="post-metadata">

**Author:** ![rose](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rose/32/7816_2.png) [@rose](https://discuss.circleci.com/u/rose)\
**Post date:** [January 3, 2019, 5:24pm UTC](https://discuss.circleci.com/t/env-type-in-orbs/27424/5 "2019-01-03T17:24:45Z")

</div>

Closed on January 3, 2019, 5:24pm UTC


