Skip to content

chore(release): v2.0.0 - [CU-869b8rv0u] #21

chore(release): v2.0.0 - [CU-869b8rv0u]

chore(release): v2.0.0 - [CU-869b8rv0u] #21

name: Main Branch Protection
on:
pull_request:
types: [opened, synchronize, reopened]
branches: [main]
jobs:
validate-merge-permissions:
runs-on: ubuntu-latest
name: Validate Merge Permissions
steps:
- name: Verify Authorized User
run: |
TARGET_BRANCH="${{ github.event.pull_request.base.ref }}"
PR_AUTHOR="${{ github.actor }}"
ALLOWED_USER="AhmedSobhy01"
if [ "$PR_AUTHOR" != "$ALLOWED_USER" ] && [ "$TARGET_BRANCH" = "main" ]; then
echo "Unauthorized PR to main by $PR_AUTHOR, only $ALLOWED_USER is allowed."
exit 1
fi
echo "Authorized PR to main branch."