Skip to content

Commit 1da8cc0

Browse files
committed
Fix PREVIEW_URL in Dependabot preview environments
1 parent 022a187 commit 1da8cc0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

amplify.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ frontend:
99
- node -v
1010
- |
1111
if [[ "${AWS_BRANCH}" != "main" && "${AWS_BRANCH}" != "staging" ]]; then
12-
PREVIEW_URL="https://${AWS_BRANCH}.${AWS_APP_ID}.amplifyapp.com";
12+
SUBDOMAIN="$(echo $AWS_BRANCH | sed 's/[^a-zA-Z0-9-]/-/g')"
13+
PREVIEW_URL="https://${SUBDOMAIN}.${AWS_APP_ID}.amplifyapp.com";
1314
NEXTAUTH_URL=$PREVIEW_URL;
1415
echo "PREVIEW_URL=$PREVIEW_URL" >> .env;
1516
fi

0 commit comments

Comments
 (0)