Skip to content

Commit

Permalink
Merge pull request #325 from Gary-Community-Ventures/feat/dev-branch-…
Browse files Browse the repository at this point in the history
…workflow-api

Add check branch GH workflow
  • Loading branch information
CalebPena authored Apr 17, 2024
2 parents 98ca3a4 + 9adbe59 commit 3330535
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/enforcer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Check Branch

on: pull_request

jobs:
check_branch:
name: Check base and head branches
runs-on: ubuntu-latest
steps:
- name: dev into main
if: ${{ github.base_ref == 'main' && github.head_ref == 'dev' }}
run: echo "Your pull request is for dev into main." && exit 0
- name: feature branch into dev
if: ${{ github.base_ref == 'dev' }}
run: echo "TESTING Your pull request is for a feature branch into dev." && exit 0
- name: non dev branch into main
if: ${{ github.base_ref == 'main' && github.head_ref != 'dev' }}
run: |
echo "ERROR: You can only merge the dev branch into main." && exit 1

0 comments on commit 3330535

Please sign in to comment.