# Variables set in \`Secrets\` can be use in normal build but not in a PR build

**URL:** <https://discuss.bitrise.io/t/variables-set-in-secrets-can-be-use-in-normal-build-but-not-in-a-pr-build/5879>\
**Category:** Question & Answer\
**Created:** [August 10, 2018, 3:13am UTC](https://discuss.bitrise.io/t/variables-set-in-secrets-can-be-use-in-normal-build-but-not-in-a-pr-build/5879 "2018-08-10T03:13:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xmeicaltex](https://avatars.discourse-cdn.com/v4/letter/x/f04885/32.png) [@xmeicaltex](https://discuss.bitrise.io/u/xmeicaltex)\
**Post date:** [August 10, 2018, 3:13am UTC](https://discuss.bitrise.io/t/variables-set-in-secrets-can-be-use-in-normal-build-but-not-in-a-pr-build/5879/1 "2018-08-10T03:13:03Z")

</div>

As we are using JFrog for private maven repository syncing server. We set the jfrog credentials in `Secrets` for workflow.

Every time when we create/update a PR from feature branch to develop branch, it will trigger 2 builds  
First: `feature/test`  
Second: ![image](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/9/99d1d6b5f9aa1ca3535c734bfd2d3f0a82f84157.png)

So the first build can actually read the credentials defined in `Secrets` and the build will succeed  
But the second build cannot read the credentials or the credentials are just got as empty string. And the build will fail.

I actually echo the jfrog credentials in bash script. I can see the first build can echo the correct credentials while the second one echos empty string

Can someone help or has anyone met this issue before?

Thanks

---

<div class="post-metadata">

**Author:** ![koral](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/koral/32/357_2.png) [@koral](https://discuss.bitrise.io/u/koral)\
**Post date:** [August 10, 2018, 2:52pm UTC](https://discuss.bitrise.io/t/variables-set-in-secrets-can-be-use-in-normal-build-but-not-in-a-pr-build/5879/2 "2018-08-10T14:52:18Z")

</div>

There is a `Expose for Pull Requests?` switch under the value input. It is disabled by default. That’s why secrets are not available in PRs. You can turn it on to change that.  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/b/bf2cd97673f30d001bbb1451ba2d891e072c36c7.png)

---

<div class="post-metadata">

**Author:** ![xmeicaltex](https://avatars.discourse-cdn.com/v4/letter/x/f04885/32.png) [@xmeicaltex](https://discuss.bitrise.io/u/xmeicaltex)\
**Post date:** [August 13, 2018, 12:35am UTC](https://discuss.bitrise.io/t/variables-set-in-secrets-can-be-use-in-normal-build-but-not-in-a-pr-build/5879/3 "2018-08-13T00:35:22Z")

</div>

@koral Thank you so much. Yeah, it works

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [September 12, 2018, 12:35am UTC](https://discuss.bitrise.io/t/variables-set-in-secrets-can-be-use-in-normal-build-but-not-in-a-pr-build/5879/4 "2018-09-12T00:35:26Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
