Skip to content
Snippets Groups Projects
Commit 05cb63dd authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

Merge Substrate master before checking Polkadot companion (#5916)

* Merge Substrate master before checking Polkadot companion

* Also merge polkadot/master into the companion pr branch

* Set email and user name
parent ffb2d09a
No related merge requests found
......@@ -39,15 +39,22 @@ substrate's branch. if it can't find anything, it will uses master instead
EOT
# Set the user name and email to make merging work
git config --global user.name 'CI system'
git config --global user.email '<>'
SUBSTRATE_PATH=$(pwd)
# Merge master into our branch before building Polkadot to make sure we don't miss
# any commits that are required by Polkadot.
git merge origin/master
# Clone the current Polkadot master branch into ./polkadot.
git clone --depth 1 https://github.com/paritytech/polkadot.git
cd polkadot
# either it's a pull request then check for a companion otherwise use
# either it's a pull request then check for a companion otherwise use
# polkadot:master
if expr match "${CI_COMMIT_REF_NAME}" '^[0-9]\+$' >/dev/null
then
......@@ -78,12 +85,14 @@ then
boldprint "companion pr specified/detected: #${pr_companion}"
git fetch --depth 1 origin refs/pull/${pr_companion}/head:pr/${pr_companion}
git checkout pr/${pr_companion}
git merge origin/master
else
pr_ref="$(grep -Po '"ref"\s*:\s*"\K(?!master)[^"]*' "${pr_data_file}")"
if git fetch --depth 1 origin "$pr_ref":branch/"$pr_ref" 2>/dev/null
then
boldprint "companion branch detected: $pr_ref"
git checkout branch/"$pr_ref"
git merge origin/master
else
boldprint "no companion branch found - building polkadot:master"
fi
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment