Skip to content

Commit b6dd585

Browse files
vulkoingimroboquat
authored andcommitted
Prompt on preview create if branch is not in remote
1 parent 1ef20eb commit b6dd585

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

dev/preview/workflow/preview/preview.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33

44
set -euo pipefail
55

6-
ROOT="$(realpath "$(dirname "$0")")/../../../../"
6+
SCRIPT_PATH=$(realpath "$(dirname "$0")")
77

8-
source "${ROOT}/dev/preview/workflow/lib/ensure-gcloud-auth.sh"
9-
source "${ROOT}/dev/preview/workflow/lib/common.sh"
10-
source "${ROOT}/dev/preview/workflow/lib/git.sh"
8+
# shellcheck source=../lib/common.sh
9+
source "$(realpath "${SCRIPT_PATH}/../lib/common.sh")"
10+
11+
import "ensure-gcloud-auth.sh"
12+
import "git.sh"
1113

1214
# Don't prompt user before terraform apply
1315
export TF_INPUT=0
@@ -19,7 +21,8 @@ if git:is-on-main; then
1921
fi
2022

2123
if ! git:branch-exists-remotely; then
22-
log_warn "Your branch doesn't exist on GitHub. Your preview environment might get garbage collected at any time. To avoid this please push your branch."
24+
log_warn "Your branch doesn't exist on GitHub. Your preview environment WILL get garbage collected after AT MOST 1h. To avoid this please push your branch."
25+
ask "I've read 👆 and I understand the implications."
2326
fi
2427

2528
ensure_gcloud_auth

0 commit comments

Comments
 (0)