-
Notifications
You must be signed in to change notification settings - Fork 1
25 lines (23 loc) · 1.06 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
name: 'Check Branch'
on:
pull_request:
jobs:
check_branch:
runs-on: ubuntu-latest
steps:
- name: Check Refs
run: |
echo "Base Repo: ${{ github.event.pull_request.base.repo.full_name }}"
echo "Base Ref: ${{ github.base_ref }}"
echo "Head Repo: ${{ github.event.pull_request.head.repo.full_name }}"
echo "Head Ref: ${{ github.head_ref }}"
- name: Check main
if: github.base_ref == 'main' && (github.head_ref != 'develop' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
run: |
echo "ERROR: You can only merge to main from develop. ${{ github.base_ref }} ${{ github.head_ref }}"
exit 1
- name: Check develop
if: github.base_ref == 'develop' && (github.head_ref != 'nightly' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
run: |
echo "ERROR: You can only merge to develop from nightly. ${{ github.base_ref }} ${{ github.head_ref }}"
exit 1