Skip to main content

Why is CIRCLE_PR_NUMBER empty?

The CIRCLE_PR_NUMBER variable is only available on forked Pull Requests

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
Did this answer your question?