/home/circleci/project/node_modules/ci-env/index.js:29
pull_request_number = process.env.CI_PULL_REQUEST.split('/').pop() // take number from returns url
^
TypeError: Cannot read property 'split' of undefined
at Object.<anonymous> (/home/circleci/project/node_modules/ci-env/index.js:29:52)
The failure occurs when trying to submit the initial status from the dependent repo bundle size (https://github.com/siddharthkp/bundlesize/blob/master/src/init-status.js). This error was only occurring on our main branch, but not on individual pull request runs. That makes me think there was some kind of involvement in the "picked randomly" PR numbers for merges, quoted below. Possibly the build number exists for the PR, then there's a fast-forward of the main branch, and that causes the duplication interaction. But I'm speculating there. The docs for these env variables: (https://circleci.com/docs/2.0/env-vars/#build-details)
CIRCLE_PULL_REQUESTS
Comma-separated list of pull requests this build is a part of.
CIRCLE_PULL_REQUEST
If this build is part of only one pull request, its URL will be populated here. If there was more than one pull request, it will contain one of the pull request URLs (picked randomly).
CI_PULL_REQUESTS
Same as CIRCLE_PULL_REQUESTS, only kept for the backward compatibility with 1.0.
CI_PULL_REQUEST
Same as CIRCLE_PULL_REQUEST, only kept for the backward compatibility with 1.0.
I noticed the error coincided with this repo's released version 1.5.0 and 1.5.1 yesterday, so I attempted to manually pin the version 1.4.0. I also confirmed that version 1.5.1 was being installed prior to pinning 1.4. This was successful, the error ceased.