#!/bin/bash
source "$ROOT_PATH"/scripts/common.sh


git config --global user.email "svc-github@perimeter81.com"
git config --global user.name "Sayuser"
export GIT_TOKEN=$GLOBAL_CICD_GIT_TOKEN

echo_green_bg "push the commit to main/master branch:"
git push
status=$?

if [ $status -eq 0 ]; then
  echo_green "done to push the commit to main/master branch"
  echo_green "git push successful"
else
  echo_red_bg ":x: ERROR - failed to push changes back to main/master" >> $GITHUB_STEP_SUMMARY
  echo_red_bg "git push failed with exit code $status, exiting" && exit 1
fi

echo "git push tag:"
git push --tags
#git push origin ${NEW_VERSION}
echo_green_bg "done to push the tag"