# How to use shared secrets in pipeline

**URL:** <https://community.codefresh.io/t/how-to-use-shared-secrets-in-pipeline/906>\
**Category:** Pipeline Workflows\
**Created:** [April 20, 2023, 7:21am UTC](https://community.codefresh.io/t/how-to-use-shared-secrets-in-pipeline/906 "2023-04-20T07:21:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![divyang.betcloud](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/divyang.betcloud/32/588_2.png) [@divyang.betcloud](https://community.codefresh.io/u/divyang.betcloud)\
**Post date:** [April 20, 2023, 7:21am UTC](https://community.codefresh.io/t/how-to-use-shared-secrets-in-pipeline/906/1 "2023-04-20T07:21:11Z")

</div>

Shared secret

- CREDS
  - USERNAME: xxx
  - PASS: xxxx

in pipeline, configured shared secret. How to do substitution in a command

e.g. `git login ${{secrets.CREDS.USERNAME}} ${{secrets.CREDS.PASS}}`

OR `git login ${{CREDS.USERNAME}} ${{CREDS.PASS}}`

---

<div class="post-metadata">

**Author:** ![divyang.betcloud](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/divyang.betcloud/32/588_2.png) [@divyang.betcloud](https://community.codefresh.io/u/divyang.betcloud)\
**Post date:** [April 20, 2023, 7:24am UTC](https://community.codefresh.io/t/how-to-use-shared-secrets-in-pipeline/906/2 "2023-04-20T07:24:00Z")

</div>

![image](https://us1.discourse-cdn.com/flex019/uploads/codefreshtest/original/1X/6e42e85ec2320f0aa584a3efcef52894635153ab.png)

---

<div class="post-metadata">

**Author:** ![Kostis](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/kostis/32/391_2.png) [@Kostis](https://community.codefresh.io/u/Kostis)\
**Post date:** [April 21, 2023, 9:24pm UTC](https://community.codefresh.io/t/how-to-use-shared-secrets-in-pipeline/906/3 "2023-04-21T21:24:56Z")

</div>

Hello

I think what you show in the screenshot is shared configuration [Shared configuration for pipelines · Codefresh | Docs](https://codefresh.io/docs/docs/pipelines/configuration/shared-configuration/#using-external-secrets-as-values)

The syntax you use seems to be from the Enterprise feature that is not enabled by default [Secrets in pipelines · Codefresh | Docs](https://codefresh.io/docs/docs/pipelines/configuration/secrets-store/)

Can you please open a ticket with us so that our support team can investigate?

---

<div class="post-metadata">

**Author:** ![divyang.betcloud](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/divyang.betcloud/32/588_2.png) [@divyang.betcloud](https://community.codefresh.io/u/divyang.betcloud)\
**Post date:** [April 24, 2023, 4:09am UTC](https://community.codefresh.io/t/how-to-use-shared-secrets-in-pipeline/906/4 "2023-04-24T04:09:51Z")

</div>

Hi @Kostis  
Yes. I am using Shared Configration Secrets.  
There are no explicit instructions in the document about how to use Shared Configuration Secrets.  
It’s not an enterprise feature.

---

<div class="post-metadata">

**Author:** ![Alexander\_Mankinenko](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/alexander_mankinenko/32/437_2.png) [@Alexander\_Mankinenko](https://community.codefresh.io/u/Alexander_Mankinenko)\
**Post date:** [May 12, 2023, 9:18am UTC](https://community.codefresh.io/t/how-to-use-shared-secrets-in-pipeline/906/5 "2023-05-12T09:18:52Z")

</div>

Hi,

To use the Shared Secrets you need to add the Shared Context you created in your pipeline as described here:

> **[Shared configuration for pipelines](https://codefresh.io/docs/docs/pipelines/configuration/shared-configuration/#using-shared-environment-variables)**
>
> How to keep your pipelines DRY

And then you will be able to refer the variables from that context just like the regular env variables:

`git login ${{USERNAME}} ${{PASS}}`
