From 6c4059432bcc5ba7e7bff4747db77a4b582c41cb Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Tue, 26 Nov 2024 13:30:21 -0800 Subject: [PATCH] Add check around branch name Signed-off-by: Derek Nola --- .github/workflows/e2e.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 7e59960ed6e6..75c211c5b0bc 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -162,7 +162,20 @@ jobs: fi echo "Branch Name is $BRANCH_NAME" echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_OUTPUT - + # branch name should be either master or release-1.XX + - name: Fail if branch name does not match pattern + run: | + if [[ ! ${{ steps.branch_step.outputs.branch_name }} =~ ^(master|release-[0-9]+\.[0-9]+)$ ]]; then + echo "Branch name ${{ steps.branch_step.outputs.branch_name }} does not match pattern" + exit 1 + fi + - name: On Failure, Launch Debug Session + uses: lhotari/action-upterm@v1 + if: ${{ failure() }} + with: + ## If no one connects after 5 minutes, shut down server. + wait-timeout-minutes: 5 + docker-go: needs: [build, build-go-tests] name: Docker Tests In GO