I am still experiencing the issue with CIRCLE_PULL_REQUEST not being set, although this is restricted to pull request from a particular engineer on our team. The “rerun” fix works for us every time but this is very annoying.
Looks like this discussion was closed prematurely: CIRCLE_PULL_REQUEST not being set