diff --git a/scripts/set-package-version.js b/scripts/set-package-version.js index 06d6c6d09d2..31928e5575a 100755 --- a/scripts/set-package-version.js +++ b/scripts/set-package-version.js @@ -33,7 +33,7 @@ try { if (TRAVIS_MODE === 'netlifyPr') { newVersion += `-pr.${getCommitHash().substr(0, 8)}`; } else if (TRAVIS_MODE === 'netlifyBranch') { - newVersion += `-branch.${process.env.BRANCH /* set by netlify */}.${getCommitHash().substr(0, 8)}`; + newVersion += `-branch.${process.env.BRANCH/* set by netlify */.replace(/[^a-zA-Z0-9]/g, '-')}.${getCommitHash().substr(0, 8)}`; } else { newVersion += `-canary.${getCommitNum()}`; }