Revert "Fix: bashisms - step 2"
[releng/builder.git] / jjb / autorelease / autorelease-gerrit-branch-lock.sh
index 1d196496f5f6fe6fec0a968e1a898f0da2d26002..e3c6a8bfe17c9f4eb8f26ec94968173da861a9eb 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2022 The Linux Foundation and others.
@@ -48,7 +48,7 @@ mode="${GERRIT_ACCESS_MODE}"
 set -x
 case $mode in
     branch-cut)
-        if [ "${GERRIT_BRANCH}" = "master" ] && expr "${GERRIT_BRANCH_NEXT}" : "stable/.*"; then
+        if [ "${GERRIT_BRANCH}" == "master" ] && [[ "${GERRIT_BRANCH_NEXT}" =~ stable ]]; then
             echo "INFO: Locking branch for new branch cutting: ${GERRIT_BRANCH_NEXT}"
             git config -f project.config "access.refs/for/refs/heads/${GERRIT_BRANCH_NEXT}.exclusiveGroupPermissions" "create"
             git config -f project.config "access.refs/for/refs/heads/${GERRIT_BRANCH_NEXT}.create" "block group Registered Users"