diff --git a/entrypoint.sh b/entrypoint.sh index af2657d..e1ae580 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,18 +2,24 @@ set -e +// go level up from the workspace cd .. +// configure Git git config --global user.email $GIT_USER_EMAIL git config --global user.name $GIT_USER_NAME +// clone the stoplight repository git clone https://$STOPLIGHT_USERNAME:$STOPLIGHT_GIT_TOKEN@git.stoplight.io/$STOPLIGHT_ORG/$STOPLIGHT_PROJECT.git -git checkout version/1.0 -cp ./workspace/$HUB_FILEPATH ./$STOPLIGHT_PROJECT/$HUB_FILEPATH +// go into the stoplight repo and checkout the "version" branch +cd $STOPLIGHT_PROJECT +git checkout version/1.0 -cd workspace +// copy the hub file from workspace to stoplight repo +cp ../workspace/$HUB_FILEPATH $HUB_FILEPATH +// add, commit and push the stoplight repo git add -A git commit -m "hub file update from GitHub" git push