Skip to content

Commit ece8c4c

Browse files
authored
Merge pull request #1263 from CruGlobal/fix-dependabot-previews
[no-Jira] Fix PREVIEW_URL in Dependabot preview environments
2 parents 022a187 + 1da8cc0 commit ece8c4c

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)