From 13c746bf31f301cc97cd75bd06d5ca0a02e9d8d8 Mon Sep 17 00:00:00 2001 From: Tyler Biethman Date: Fri, 29 Jul 2022 12:38:47 -0500 Subject: [PATCH] chore: updating run binary CI scripts to support external contributors --- circle.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 94c3dc7339a6..80f537aa058e 100644 --- a/circle.yml +++ b/circle.yml @@ -873,7 +873,16 @@ commands: # Ensure we're installing the node-version for the cloned repo command: | if [[ -f .node-version ]]; then - curl -L https://raw.githubusercontent.com/cypress-io/cypress/<< pipeline.git.branch >>/scripts/ensure-node.sh --output ci-ensure-node.sh + branch="<< pipeline.git.branch >>" + + externalBranchPattern='^pull\/[0-9]+' + if [[ $branch =~ $externalBranchPattern ]]; then + # We are unable to curl from the external PR branch location + # so we fall back to develop + branch="develop" + fi + + curl -L https://raw.githubusercontent.com/cypress-io/cypress/$branch/scripts/ensure-node.sh --output ci-ensure-node.sh else # if no .node-version file exists, we no-op the node script and use the global yarn echo '' > ci-ensure-node.sh