Skip to content

Commit

Permalink
chore: update workflow to prevent non-release PRs to main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
bayological committed Sep 17, 2024
1 parent 73d2843 commit c3f8ed4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/check-branch.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Prevent PR to Main
name: Prevent Non-Release PRs to Main

on:
pull_request:
Expand All @@ -9,7 +9,9 @@ jobs:
check-target-branch:
runs-on: ubuntu-latest
steps:
- name: Fail if PR targets the main branch
- name: Check if the source branch is a release branch
run: |
echo "PRs should not be merged into the main branch directly."
exit 1
if [[ "${{ github.head_ref }}" != release/* ]]; then
echo "Only release branches can be merged into the main branch."
exit 1
fi

0 comments on commit c3f8ed4

Please sign in to comment.