name: Pull Request Source Branch Validation Check on: pull_request: branches: - master jobs: validate-pr-source: runs-on: ubuntu-latest steps: - name: Check source branch name run: | branch_name=${{ github.head_ref }} if ! [[ $branch_name =~ ^(feature|bugfix|hotfix|documentation|refactor|other)/ ]]; then echo "Error: Branch name '$branch_name' does not follow the naming convention." echo "It should start with one of: feature/, bugfix/, hotfix/, documentation/, refactor/, or other/" exit 1 fi echo "Branch name '$branch_name' follows the correct naming convention."