ci: don't run merge check on release branch + cleanup

This commit is contained in:
Jakub Panek 2024-09-02 12:17:20 +02:00 committed by Jakub Panek
parent 62bfdf8636
commit 24f5bd4e3c

View file

@ -13,14 +13,9 @@ defaults:
jobs:
check:
name: Check if non-staging -> main
runs-on: shell
if: github.base_ref == 'main'
if: github.base_ref == 'main' && !startsWith(github.ref, 'refs/heads/release/') && github.head_ref != 'staging'
steps:
- name: Check if non-staging -> main
if: github.head_ref != 'staging'
run: echo 'Cannot merge non-staging branch to main'; exit 1
- name: Check if staging -> main
if: github.head_ref == 'staging'
run: echo 'Merge from staging branch to main allowed'; exit 0