-
Notifications
You must be signed in to change notification settings - Fork 1
22 lines (22 loc) · 1.26 KB
/
validate-branch-name.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
name: Validate branch name
on: [ pull_request, workflow_call ]
jobs:
branch-name:
runs-on: ubuntu-latest
steps:
- name: Validate if branch name is valid
if: (!startsWith(github.event.pull_request.head.ref, 'release/')) && (!startsWith(github.event.pull_request.head.ref, 'hotfix/')) && github.event.pull_request.head.ref != 'crowdin-translations'
uses: deepakputhraya/action-branch-name@5f1cc199284b75145ec2d13434422e6987cf6af8
with:
regex: '^([a-z])+\/(GH-\d*|NO-ISSUE)\/([a-z-])+$'
allowed_prefixes: 'build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test'
ignore: main,develop
min_length: 5
max_length: 50
- name: Validate if release or hotfix branch name is valid
if: startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix/')
uses: deepakputhraya/action-branch-name@5f1cc199284b75145ec2d13434422e6987cf6af8
with:
regex: '^([a-z])+\/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
allowed_prefixes: 'release,hotfix'
ignore: main,develop