Files
archived-netvisor/.github/workflows/pr_dev_only.yml
Maya 4cde6296a8 Potential fix for code scanning alert no. 1: Code injection
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-11-24 11:45:16 -05:00

19 lines
531 B
YAML

name: Check pull request source branch
on:
pull_request_target:
types: [opened, reopened, synchronize, edited]
jobs:
check-branches:
name: pr_dev_only
runs-on: ubuntu-latest
steps:
- name: Check branches
env:
HEAD_REF: ${{ github.head_ref }}
BASE_REF: ${{ github.base_ref }}
run: |
if [ "$HEAD_REF" != "dev" ] && [ "$BASE_REF" = "main" ]; then
echo "Merge requests to main branch are only allowed from dev branch."
exit 1
fi