Skip to content

Bump @babel/preset-env from 7.23.9 to 7.24.5 in /frontend #68

Bump @babel/preset-env from 7.23.9 to 7.24.5 in /frontend

Bump @babel/preset-env from 7.23.9 to 7.24.5 in /frontend #68

name: Enforce Branch Name Semantics
on:
pull_request:
branches: ["main"]
jobs:
lint-branch-name:
name: Lint Branch Name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/github-script@v6
with:
result-encoding: string
script: |
const enforceSemantic = (branchName) => {
const semanticFormat = /(feat\W|feature\/|fix\/|chore\/|refactor\/|dependabot\/|docs\/|style\/|test\/)/
if (!semanticFormat.test(currentBranch)) {
core.setFailed(
`Branch names in PRs should use semantic conventions, e.g. (feat, fix, chore, refactor). To fix. ` +
`perform: git branch -m <new_branch_name> && git push origin -u <:<old_branch_name> <new_branch_name>` +
`For more details, please review https://www.conventionalcommits.org/ and https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716`)
}
}
const currentBranch = context.payload.pull_request.head.ref
enforceSemantic(currentBranch)