mirror of
https://github.com/penpot/penpot-helm.git
synced 2025-04-07 20:31:25 -05:00
chore: action to prevent PRs to main branch
This commit is contained in:
parent
16dd0b7c55
commit
5e32e29171
1 changed files with 19 additions and 0 deletions
19
.github/workflows/prevent-prs-to-main.yml
vendored
Normal file
19
.github/workflows/prevent-prs-to-main.yml
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
name: Prevent external Pull Request to 'main' branch
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
- edited
|
||||
jobs:
|
||||
check-branches:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check Pull Reques base and target branches
|
||||
run: |
|
||||
if [ ${{ github.head_ref }} != "develop" ] && [ ${{ github.base_ref }} == "main" ]; then
|
||||
echo "Pull Requests to 'main' branch are only allowed from 'develop' branch."
|
||||
echo "You can make your Pull Requests to 'develop'."
|
||||
exit 1
|
||||
fi
|
Loading…
Add table
Reference in a new issue