Wplace-BlueMarble/.github/workflows/pr-branch-check.yml
SwingTheVine a4c4fe6a06
Potential fix for code scanning alert no. 30: Workflow does not contain permissions
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-08-17 01:02:31 -04:00

21 lines
527 B
YAML

name: Enforce allowed branches for PRs to main
permissions:
contents: read
on:
pull_request:
branches:
- main
jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Check PR source branch
run: |
echo "Source branch: ${{ github.head_ref }}"
if [[ "${{ github.head_ref }}" != "documentation" && "${{ github.head_ref }}" != "code" ]]; then
echo "Error: PRs to main must come from 'documentation' or 'code' branches only."
exit 1
fi