Skip to content

chore(release): merge dev to main #277

chore(release): merge dev to main

chore(release): merge dev to main #277

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;
}
}