Skip to content

update workflow #296

update workflow

update workflow #296

name: Enforce Pull Request Rules
on:
pull_request:
jobs:
check_branch:
runs-on: ubuntu-20.04
steps:
- name: Check Pull Requests Against `main`
if: ${{ github.base_ref == 'main' && !contains(fromJson('["stage"]'), github.head_ref) }}
run: |
echo "Error: You can only merge to `main` from `stage`."
exit 1
- name: Check Pull Requests Against `stage`
if: ${{ github.base_ref == 'stage' && !contains(fromJson('["develop","fix/*"]'), github.head_ref) }}
run: |
echo "Error: You can only merge to `stage` from `develop or a fix branch`."
exit 1