From b37d736f28a13f73350a62e6094fb90c76c65221 Mon Sep 17 00:00:00 2001 From: Maarten de Kruijf Date: Fri, 8 Mar 2024 18:40:39 +0100 Subject: [PATCH] Moved to bash --- .github/workflows/branch.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index a03e9ac6..6a26f9a4 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -4,14 +4,13 @@ on: push: branches: - '**' - +env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + jobs: check-branch-name: - if: | - ${{ ! contains(github.ref_name, 'feature/') || ! contains(github.ref_name, 'development') - || ! contains(github.ref_name, 'master') || ! contains(github.ref_name, 'bugfix/') - ||! contains(github.ref_name, 'hotfix/') || ! contains(github.ref_name, 'release/') }} runs-on: ubuntu-latest steps: - - name: Fail - run: exit 1 \ No newline at end of file + - name: Check for branch name + run: + if [[ $BRANCH_NAME =~ (feature|bugfix|hotfix|development|release|master)\/* ]]; then exit 0; else exit 1; fi \ No newline at end of file