Skip to content

Commit

Permalink
CID-1624: Enforce branch name pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedlajmileanix committed Nov 21, 2023
1 parent 27f1b11 commit 988bfca
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@ concurrency:

on:
push:
branches:
- main
- feature/**
workflow_dispatch:

jobs:
validation:
name: Branch name validation
runs-on: ubuntu-latest
steps:
- name: Check branch name
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]] || [[ "${{ github.ref }}" =~ ^refs/heads/feature/.*$ ]] || [[ "${{ github.ref }}" =~ ^refs/heads/bug/.*$ ]] ; then
echo "Branch naming is correct!"
else
echo "Invalid branch name! Correct format: 'feature/<branch-name>' or 'bug/<branch-name>'"
exit 1
fi
gradle-ci:
name: Build and test
needs: validation
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down

0 comments on commit 988bfca

Please sign in to comment.