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

build(vrt): sanitize branch names #2948

Merged
merged 2 commits into from Feb 28, 2020
Merged

build(vrt): sanitize branch names #2948

merged 2 commits into from Feb 28, 2020

Conversation

sandgraham
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Feb 28, 2020

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/uber-ui-platform/baseweb/dieot298c
✅ Preview: https://baseweb-git-vrt-sanitize-branch.uber-ui-platform.now.sh

vrt/ci.js Outdated Show resolved Hide resolved
function sanitizeBranchName(branchName) {
// Colons are not permitted in git branch names and for some reason
// Buildkite will report the branch name as "user:branch".
return branchName.replace(/:/g, '-');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we sanitize even more characters and use some 3rd party lib?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fine since we are only protecting against the colon that buildkite might add to the actual branch name. The user's actual branch name can't be created in the first place if it has bad characters. Not sure why buildkite does this, but I think if the branch is called master - buildkite will append the repo owner (ex: sandgraham:master).

@sandgraham sandgraham merged commit d34aa38 into master Feb 28, 2020
@uber-baseweb-probots uber-baseweb-probots bot deleted the vrt-sanitize-branch branch February 28, 2020 23:30
VladimirMilenko pushed a commit to VladimirMilenko/baseui that referenced this pull request Apr 2, 2020
* build(vrt): sanitize branch names

* Update vrt/ci.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants