Build from the branch of the upstream repo that triggered this job.
The CI/CD is triggered by a merge to master from one of the react components. Also the upstream job is configured to fail if the styleguidist build fails. Therefore, the documentation must be built from that react component's branch.
Update the CI/CD to expect variables defined by the up-stream trigger defining it's repo & branch. If defined, the build should use this branch when building it's documentation (obviously master should be used for all other components should).