I can confirm. Having the same issue.

Thanks for reporting this everyone. We’ve merged some changes that should fix the issue.

I just ran a test build on a branch with an open PR and the env vars were populated correctly:

Do let us know if it’s still not resolved for you.

Hello @tom,

This problem still occurs.

Sometimes CIRCLE_PULL_REQUEST environment variable are set.

I do not know the reproduction condition.
Two containers are executed in parallel by CircleCI Workflow, but this happens frequently in containers using alpine images.


This issue occurred again in another repository.
Workflow and alpine image had nothing to do with the issue.

We are experiencing the same issue. Sometimes rebuilding will fix this.

Same thing for us. Sometimes the variable is not set and therefor our tests are not running

Thanks for checking and getting back to us. Our engineers are still looking into this, and we’ve been able to reproduce it inconsistently. Our working theory right now is that this is a race condition between two Github hooks, one for a push and one for a PR commit. We’ve been able to reproduce this using a commit from the Github PR web UI, so it’s not a simple matter of “create a PR then push to it”.

For now, rebuilding is the only suggestion I have while our engineers look into this further.

Any updates on this? We heavily use the environment variable for a ton of automation we do. Having to rebuild a PR so often is kind of disheartening :frowning:

Seeing this too. Hopefully someone can provide a fix for this soon.

We’re also seeing it. Since the “Only build pull requests” is locked to the default branch on git we rely on this env var to reimplement this feature as we have more than one release branch where we need to run builds on all commits.

We can at the same time not run builds on commits on branches that isn’t a PR yet.

If this can’t be resolved we’ll be forced to switch to another CI provider


seeing the same behavior at the moment.

The product should generally perform better with executing jobs around the moment a pull request is created, because a lot of QA work should be done at that moment.

I’ve seen issues mentioning this very often, but no one from the team mentioned how the direction for that feature will be.

Kind regards,


We have rolled out a fix. Please let us know if you are still experiencing this issue. Thank you so much for your patience.

Same for java circleci/openjdk:8-jdk and circleci/openjdk:9-jdk images

The following environment variables are not set:

Sorry to hear that. Can you please DM the build link where you are experiencing this issue? Thanks!

Still seeing the same issue, none of the PR variables are being set.

I am having the same issue.
One example would be:

I am printing the PR# as
println “GitHub PR is #${System.env.CIRCLE_PR_NUMBER}”

The result is
GitHub PR is #null

1 Like

This is still happening: shows a PR build and the CIRCLE_PULL_REQUEST{,S} variables aren’t set.

We are also still experiencing this. Rebuilding does not solve the problem. “Only build pull requests” is not an option for our organization either.

Hi, I’ve experienced the same Issue in have a look at the env|sort step which prints all set env vars.
Interesting is, CIRCLE_PULL_REQUEST is defined, but CIRCLE_PR_NUMBER is not. this build was directly triggered from github, however there is no change when rebuilding it directly in circeci.

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