22
33tools=" ../drivers-evergreen-tools"
44git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $tools
5- body=" $( cat " $1 " ) "
65
7- pushd $tools /.evergreen/github_app
6+ pushd $tools /.evergreen/github_app || exit
87
98owner=" mongodb"
109repo=" mongo-python-driver"
@@ -23,11 +22,11 @@ echo "Getting github token..."
2322token=$( bash ./get-access-token.sh $repo $owner )
2423if [ -z " ${token} " ]; then
2524 echo " Failed to get github access token!"
26- popd
25+ popd || exit
2726 exit 1
2827fi
2928echo " Getting github token... done."
30- popd
29+ popd || exit
3130
3231# Make the git checkout and create a new branch.
3332echo " Creating the git checkout..."
@@ -40,19 +39,14 @@ git apply -R .evergreen/specs.patch
4039git commit -am " resyncing specs test?"
4140echo " Creating the git checkout... done."
4241
43- echo " THIS IS THE BODY"
44- echo " $body "
4542git push origin $branch
46- echo " {\" title\" :\" [Spec Resync] $( date ' +%m-%d-%Y' ) \" ,\" body\" :\" $( cat " $1 " ) \" ,\" head\" :\" ${branch} \" ,\" base\" :\" master\" }"
4743resp=$( curl -L \
4844 -X POST \
4945 -H " Accept: application/vnd.github+json" \
5046 -H " Authorization: Bearer $token " \
5147 -H " X-GitHub-Api-Version: 2022-11-28" \
5248 -d " {\" title\" :\" [Spec Resync] $( date ' +%m-%d-%Y' ) \" ,\" body\" :\" $( cat " $1 " ) \" ,\" head\" :\" ${branch} \" ,\" base\" :\" master\" }" \
5349 --url https://api.github.com/repos/$owner /$repo /pulls)
54- echo $resp
55- echo $resp | jq ' .html_url'
5650echo " Creating the PR... done."
5751
5852rm -rf $tools
0 commit comments