Skip to content

Commit

Permalink
Add job to allow only dev branch to be merged to main
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaranvpl committed Apr 16, 2024
1 parent 2fc6982 commit 434ce1d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/enforcer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Check Branch'

on:
pull_request:
merge_group:

jobs:
check_branch:
runs-on: ubuntu-latest
steps:
- name: Check branch
if: github.base_ref == 'main' && github.head_ref != 'dev'
run: |
echo "ERROR: You can only merge to main from dev."
exit 1

0 comments on commit 434ce1d

Please sign in to comment.