Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX beta] prevent test error by converting illegal characters #16200

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion broccoli/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ module.exports.VERSION = (() => {
// * current "build type" or branch name (in CI this is generally not
// present, but it is very useful for local / testing builds)
// * the sha for the commit
let packageVersion = pkg.version;
let packageVersion = pkg.version;
let sha = info.sha || '';
let suffix = process.env.BUILD_TYPE || info.branch;
// * remove illegal non-alphanumeric characters from branch name.
suffix = suffix && suffix.replace(/[^a-zA-Z\d\s-]/, '-');
let metadata = sha.slice(0, 8);

return `${packageVersion}${suffix ? '-' + suffix : ''}+${metadata}`;
Expand Down