You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
core.info(`Assigning custom preview domain to PR`)
16618
16622
16619
-
const alias = PR_PREVIEW_DOMAIN
16620
-
.replace('{USER}', USER)
16621
-
.replace('{REPO}', REPOSITORY)
16622
-
.replace('{BRANCH}', BRANCH)
16623
+
if (typeof PR_PREVIEW_DOMAIN !== 'string') {
16624
+
throw new Error(`invalid type for PR_PREVIEW_DOMAIN`)
16625
+
}
16626
+
16627
+
const alias = PR_PREVIEW_DOMAIN.replace('{USER}', urlSafeParameter(USER))
16628
+
.replace('{REPO}', urlSafeParameter(REPOSITORY))
16629
+
.replace('{BRANCH}', urlSafeParameter(BRANCH))
16623
16630
.replace('{PR}', PR_NUMBER)
16624
16631
.replace('{SHA}', SHA.substring(0, 7))
16625
16632
.toLowerCase()
16626
16633
16627
-
await vercel.assignAlias(alias)
16634
+
const previewDomainSuffix = '.vercel.app'
16635
+
let nextAlias = alias
16636
+
16637
+
16638
+
if (alias.endsWith(previewDomainSuffix)) {
16639
+
let prefix = alias.substring(0, alias.indexOf(previewDomainSuffix))
16640
+
16641
+
if (prefix.length >= 60) {
16642
+
core.warning(`The alias ${ prefix } exceeds 60 chars in length, truncating using vercel's rules. See https://vercel.com/docs/concepts/deployments/automatic-urls#automatic-branch-urls`)
core.warning(`The alias ${prefix} exceeds 60 chars in length, truncating using vercel's rules. See https://vercel.com/docs/concepts/deployments/automatic-urls#automatic-branch-urls`)
0 commit comments