Workflows

This commit is contained in:
Moritz Utcke
2025-04-28 12:50:12 -03:00
parent 78decc697e
commit dc5c6ac557
2 changed files with 78 additions and 0 deletions

26
.github/workflows/prevent-wrong-pr.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: PR Rules Enforcement
on:
pull_request:
branches:
- main
- staging
jobs:
check-pr:
runs-on: ubuntu-latest
steps:
- name: Prevent dev merges
run: |
if [[ "${{ github.head_ref }}" == "dev" ]]; then
echo "ERROR: Merging 'dev' into '${{ github.base_ref }}' is forbidden!"
exit 1
fi
- name: Allow only staging into main
if: github.base_ref == 'main'
run: |
if [[ "${{ github.head_ref }}" != "staging" ]]; then
echo "ERROR: Only 'staging' branch is allowed to merge into 'main'. Current: '${{ github.head_ref }}'"
exit 1
fi