2017-09-24 17:45:00 +00:00
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
## PR base check script for CircleCI
|
|
|
|
|
##
|
|
|
|
|
## Copyright (c) 2012-2014 Sylvain Benner
|
2018-05-20 11:54:20 +00:00
|
|
|
|
## Copyright (c) 2014-2018 Sylvain Benner & Contributors
|
2017-09-24 17:45:00 +00:00
|
|
|
|
##
|
|
|
|
|
## Author: Eugene Yaremenko
|
|
|
|
|
## URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
|
##
|
|
|
|
|
## This file is not part of GNU Emacs.
|
|
|
|
|
##
|
|
|
|
|
## License: GPLv3
|
|
|
|
|
|
2020-06-23 16:11:09 +00:00
|
|
|
|
fail_when_undefined_pr_number
|
2017-09-24 17:45:00 +00:00
|
|
|
|
|
|
|
|
|
pr_base=$(curl -s "${pr_data_URL}" | jq '.base.ref')
|
2021-07-05 14:58:55 +00:00
|
|
|
|
if [[ "${pr_base}" == "\"develop\"" ]]; then
|
2018-08-22 12:25:45 +00:00
|
|
|
|
echo "You are PRing to the develop branch. This is good."
|
|
|
|
|
exit 0
|
2021-07-05 14:58:55 +00:00
|
|
|
|
elif [[ "${pr_base}" == "\"master\"" ]]; then
|
2018-08-22 12:25:45 +00:00
|
|
|
|
printf '=%.0s' {1..80}
|
|
|
|
|
printf "\n し(*・∀・)/ Thanks for the contribution! \(・∀・*)ノ\n"
|
|
|
|
|
printf '=%.0s' {1..80}
|
|
|
|
|
printf "\n( ^◡^)っ Please submit your PR against the develop branch.\n"
|
|
|
|
|
echo "You can read the contribution guidelines at:"
|
|
|
|
|
echo "https://github.com/syl20bnr/spacemacs/blob/develop/CONTRIBUTING.org"
|
|
|
|
|
exit 2
|
2017-09-24 17:45:00 +00:00
|
|
|
|
else
|
2018-08-22 12:25:45 +00:00
|
|
|
|
echo_headline "Your PR has unrecognized base: \"${pr_base}\""
|
|
|
|
|
exit 2
|
2017-09-24 17:45:00 +00:00
|
|
|
|
fi
|