Why is CIRCLE_PR_NUMBER empty?

The CIRCLE_PR_NUMBER variable is only available on forked Pull Requests

You can find additional information here: https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables

Additionally, the CIRCLE_PULL_REQUEST environment variable will be populated on any build associated with any pull request. You can use the following syntax to extract out just the PR number:

${CIRCLE_PULL_REQUEST##*/}

The value of CIRCLE_PULL_REQUEST environment variable is set to something like the following: 

https://github.com/org/project/pull/1728

When you use the above syntax, the following is extracted from the CIRCLE_PULL_REQUEST environment variable :

1728
Was this article helpful?
20 out of 26 found this helpful

Comments

0 comments

Article is closed for comments.