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

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

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

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

2 Likes

@koral Thank you so much. Yeah, it works

1 Like

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