The CIRCLE_PR_NUMBER
variable is only available on forked Pull Requests, we note that here:
https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables
However, CIRCLE_PULL_REQUEST
should be populated on any build associated with any pull request. You can then use the following to extract out just the PR number:
${CIRCLE_PULL_REQUEST##*/}
This would take the value which is normally something like:
https://github.com/org/project/pull/1728
And turn it simply to:
1728
Comments
Article is closed for comments.