You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
889 B

  1. #!/bin/sh
  2. # github-public-newbranch.bash - create public branch from the security repository
  3. set -euo pipefail
  4. # Create new branch
  5. BRANCH="${CIRCLE_TAG:-v0.0.0}-security-`date -u +%Y%m%d%H%M%S`"
  6. # Check if the patch release exist already as a branch
  7. if [ -n "`git branch | grep '${BRANCH}'`" ]; then
  8. echo "WARNING: Branch ${BRANCH} already exists."
  9. else
  10. echo "Creating branch ${BRANCH}."
  11. git branch "${BRANCH}"
  12. fi
  13. # ... and check it out
  14. git checkout "${BRANCH}"
  15. # Add entry to public repository
  16. git remote add tendermint-origin git@github.com:tendermint/tendermint.git
  17. # Push branch and tag to public repository
  18. git push tendermint-origin
  19. git push tendermint-origin --tags
  20. # Create a PR from the public branch to the assumed release branch in public (release branch has to exist)
  21. python -u scripts/release_management/github-openpr.py --head "${BRANCH}" --base "${BRANCH:%.*}"