Skip to content

Commit

Permalink
Fix action
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Feb 26, 2025
1 parent 8685255 commit cab1456
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/enforce-branch-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,12 @@ jobs:
enforce-branch-policy:
runs-on: ubuntu-latest
steps:
- name: Check for push event
if: github.event_name == 'push'
run: |
echo "Push events allowed."
exit 0
- name: Enforce main branch policy
if: github.ref == 'refs/heads/main'
- name: Enforce main branch pull request policy
if: github.event_name == 'pull_request' && github.ref == 'refs/heads/main'
run: |
echo "Pull requests to the main branch are not allowed."
exit 1
- name: Enforce develop branch policy
if: github.ref != 'refs/heads/main'
- name: Enforce main branch push policy
run: |
echo "Pull requests to the develop branch are allowed."
echo "Push events to the main branch are allowed."
exit 0

0 comments on commit cab1456

Please sign in to comment.