CI_PULL_REQUEST not present


Hi, it appears the CI_PULL_REQUEST variable is not available on the 2.0 platform. Is this known? Is there a work around for this? We need it for an automated code review tool we’re using. Thanks!



Yeah CI_PULL_REQUEST isn’t even listed :confused:


This is a pretty reasonable request. I’ve opened an internal feature request for this.


Does the existence of $CIRCLE_COMPARE_URL help at all? If it’s null, there is no pull request.


Unfortunately no. The reason we need the exact PR URL is to review the PR details and also post comments. I’ve added this for the time being:

      if [ -z "${CI_PULL_REQUEST:-}" ]; then
      export CI_PULL_REQUEST=$(curl -s -X GET -u ${DANGER_GITHUB_API_TOKEN}:x-oauth-basic "${CIRCLE_BRANCH}" | jq -r ".[0].html_url")


I hope that works for now. We will definitely support this in the future.


$CI_PULL_REQUEST(S) is now supported. However, we’d recommend using $CIRCLE_PULL_REQUEST(S) for the consistency with other env vars in 2.0.