push-translations-changes.sh 467 B

123456789101112131415161718
  1. #!/bin/bash
  2. set -e
  3. SCRIPT_PATH=$(realpath "${BASH_SOURCE[0]}")
  4. SCRIPT_DIR=$(dirname "$SCRIPT_PATH")
  5. WEB_DIR=$(dirname "$SCRIPT_DIR")
  6. cd "$WEB_DIR"
  7. if [[ `git status --porcelain=2 locales/` ]]; then
  8. git add locales/*
  9. git commit -m "auto update translation"
  10. # Switch the cloudbuild clone from https to ssh authentication.
  11. git remote set-url --push origin git@github.com:overleaf/internal.git
  12. git push origin "HEAD:$BRANCH_NAME"
  13. else
  14. echo 'No changes'
  15. fi