ci: add staging/main check
This commit is contained in:
parent
a3a0495b0c
commit
3bfdc8958d
1 changed files with 26 additions and 0 deletions
26
.forgejo/workflows/merge-main-check.yml
Normal file
26
.forgejo/workflows/merge-main-check.yml
Normal file
|
@ -0,0 +1,26 @@
|
|||
name: merge-main-check
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- edited
|
||||
- reopened
|
||||
- synchronize
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: 'sh -e {0}'
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: shell
|
||||
if: github.base_ref == 'main'
|
||||
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
|
||||
|
Loading…
Reference in a new issue