File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22set -euo pipefail
33
4+ required_profile=" NDR-Dev-RW"
5+
6+ if [[ " ${AWS_PROFILE:- } " != " $required_profile " ]]; then
7+ echo " ❌ Error: AWS_PROFILE must be set to \" $required_profile \" "
8+ echo " 👉 Example: export AWS_PROFILE=$required_profile "
9+ exit 1
10+ fi
11+
412branch=" ${WORKSPACE:- $(git rev-parse --abbrev-ref HEAD)} "
513branch=$( echo " $branch " | sed ' s/[^a-zA-Z0-9]//g' )
614branch=" ${branch,,} "
715apply=" ${APPLY:- false} "
816
917# Forbidden branches
10- forbidden_branches =(" main" " prod" " pre-prod" " ndr-test" " ndr-dev" )
18+ forbidden_workspaces =(" main" " prod" " pre-prod" " ndr-test" " ndr-dev" " preprod " " ndrtest " " ndrdev " )
1119
12- for fb in " ${forbidden_branches [@]} " ; do
20+ for fb in " ${forbidden_workspaces [@]} " ; do
1321 if [[ " $branch " == " $fb " ]]; then
14- echo " ❌ Error: Deployment from branch '$branch ' is not allowed."
22+ echo " ❌ Error: Deployment of workspace '$fb ' is not allowed. If you are trying to deploy main to your sandbox then provide a workspace name ."
1523 exit 1
1624 fi
1725done
You can’t perform that action at this time.
0 commit comments