File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
vercel-deployment-task-source/src Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,10 @@ async function run() {
245245 getStagingPrefix ( vercelOrgId , vercelToken ) ,
246246 ] ) ;
247247 const escapedBranchName = branchName . replace ( / [ ^ a - z A - Z 0 - 9 \- ] - ? / g, "-" ) ;
248+ const escapedProjectName = projectName . replace (
249+ / [ ^ a - z A - Z 0 - 9 \- ] - ? / g,
250+ "-"
251+ ) ;
248252 /**
249253 * Truncating branch name according to RFC 1035 if necessary
250254 * Maximum length is 63 characters.
@@ -272,8 +276,8 @@ async function run() {
272276 * longer-project-name-feature-prefix-12346-my-second-f.vercel.app
273277 */
274278 const branchNameAllowedLength =
275- 50 - projectName . length - stagingPrefix . length ;
276- let aliasHostname = `${ projectName } -${ escapedBranchName } -${ stagingPrefix } .vercel.app` ;
279+ 50 - escapedProjectName . length - stagingPrefix . length ;
280+ let aliasHostname = `${ escapedProjectName } -${ escapedBranchName } -${ stagingPrefix } .vercel.app` ;
277281
278282 if ( escapedBranchName . length > branchNameAllowedLength ) {
279283 // Calculate the maximum length of the branchName by removing the stagingPrefix and the dash
@@ -294,7 +298,7 @@ async function run() {
294298 }
295299
296300 // Remove the stagingPrefix from the aliasHostname and use the extended aliasingBranchName
297- aliasHostname = `${ projectName } -${ aliasingBranchName } .vercel.app` ;
301+ aliasHostname = `${ escapedProjectName } -${ aliasingBranchName } .vercel.app` ;
298302 }
299303
300304 deployURL = `https://${ aliasHostname } ` ;
You can’t perform that action at this time.
0 commit comments