2
2
3
3
tools=" ../drivers-evergreen-tools"
4
4
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $tools
5
- body=" $( cat " $1 " ) "
6
5
7
- pushd $tools /.evergreen/github_app
6
+ pushd $tools /.evergreen/github_app || exit
8
7
9
8
owner=" mongodb"
10
9
repo=" mongo-python-driver"
@@ -23,11 +22,11 @@ echo "Getting github token..."
23
22
token=$( bash ./get-access-token.sh $repo $owner )
24
23
if [ -z " ${token} " ]; then
25
24
echo " Failed to get github access token!"
26
- popd
25
+ popd || exit
27
26
exit 1
28
27
fi
29
28
echo " Getting github token... done."
30
- popd
29
+ popd || exit
31
30
32
31
# Make the git checkout and create a new branch.
33
32
echo " Creating the git checkout..."
@@ -40,19 +39,14 @@ git apply -R .evergreen/specs.patch
40
39
git commit -am " resyncing specs test?"
41
40
echo " Creating the git checkout... done."
42
41
43
- echo " THIS IS THE BODY"
44
- echo " $body "
45
42
git push origin $branch
46
- echo " {\" title\" :\" [Spec Resync] $( date ' +%m-%d-%Y' ) \" ,\" body\" :\" $( cat " $1 " ) \" ,\" head\" :\" ${branch} \" ,\" base\" :\" master\" }"
47
43
resp=$( curl -L \
48
44
-X POST \
49
45
-H " Accept: application/vnd.github+json" \
50
46
-H " Authorization: Bearer $token " \
51
47
-H " X-GitHub-Api-Version: 2022-11-28" \
52
48
-d " {\" title\" :\" [Spec Resync] $( date ' +%m-%d-%Y' ) \" ,\" body\" :\" $( cat " $1 " ) \" ,\" head\" :\" ${branch} \" ,\" base\" :\" master\" }" \
53
49
--url https://api.github.com/repos/$owner /$repo /pulls)
54
- echo $resp
55
- echo $resp | jq ' .html_url'
56
50
echo " Creating the PR... done."
57
51
58
52
rm -rf $tools
0 commit comments