chore(release): merge dev
to main
#277
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |