2019-08-14 09:36:41 -04:00
|
|
|
# We bidirectionally synchronize github.com/ruby/ruby.git's master branch and
|
|
|
|
# git.ruby-lang.org/ruby.git's master branch.
|
|
|
|
# We can use a pull request's merge button only on the master branch.
|
2019-08-12 12:45:10 -04:00
|
|
|
#
|
2019-08-14 09:36:41 -04:00
|
|
|
# Therefore, we require to pass this "check_branch" on all protected branches
|
|
|
|
# to prevent us from accidentally pushing commits to GitHub directly.
|
|
|
|
#
|
|
|
|
# Details: https://bugs.ruby-lang.org/issues/16094
|
2019-08-14 09:21:15 -04:00
|
|
|
name: pull_request
|
2019-08-12 10:36:42 -04:00
|
|
|
on: [pull_request]
|
|
|
|
jobs:
|
2019-08-14 09:21:15 -04:00
|
|
|
check_branch:
|
2019-08-12 10:36:42 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check if branch is master
|
|
|
|
run: |
|
|
|
|
if [ "$BASE_REF" != master ]; then
|
|
|
|
echo "Only master branch accepts a pull request, but it's '$BASE_REF'."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
env:
|
|
|
|
BASE_REF: ${{ github.base_ref }}
|