Skip to content

chore(deps): bump the prod-deps group across 1 directory with 4 updates #205

chore(deps): bump the prod-deps group across 1 directory with 4 updates

chore(deps): bump the prod-deps group across 1 directory with 4 updates #205

name: Branch Name
on:
pull_request:
types: [opened, synchronize]
jobs:
check-branch-name:
runs-on: ubuntu-latest
steps:
- name: Check branch name for different base branches
uses: actions/github-script@v7
with:
script: |
const base = '${{ github.base_ref }}'
const branch = '${{ github.head_ref }}'
switch(base) {
case 'main':
case 'alpha': {
if (!/^(hotfix|release)\/[A-Za-z0-9-_\.]+$/.test(branch)) {
console.error(`::error::Branch name must start with 'hotfix/*' or 'release/*' for PRs to ${base}`)
process.exit(1)
}
break;
}
case 'dev': {
if (!/^(feat|fix|chore|docs|test)\/[A-Za-z0-9-_\.]+$/.test(branch)) {
console.error(`::error::Branch name must start with '(feat|fix|chore|docs|test)/*' for PRs to ${base}`)
process.exit(1)
}
break;
}
}