clan-infra/pkgs/action-create-pr/script.sh
Jörg Thalheim 15b20d2e9e
All checks were successful
build / test (push) Successful in 7s
move devShells out of flake-parts
2023-08-03 16:18:29 +02:00

18 lines
365 B
Bash

#!/usr/bin/env bash
set -euo pipefail
REMOTE_BRANCH="${REMOTE_BRANCH:-auto-pr}"
PR_TITLE="${PR_TITLE:-'This PR was created automatically'}"
git diff --quiet || {
echo -e "\e[31mWorking tree is dirty, please commit first\e[0m"
git status
exit 1
}
git push origin "HEAD:$REMOTE_BRANCH"
tea pr create "$@" \
--head "$REMOTE_BRANCH" \
--title "$PR_TITLE"