Skip to content

Commit

Permalink
build(vrt): sanitize branch names (uber#2948)
Browse files Browse the repository at this point in the history
* build(vrt): sanitize branch names

* Update vrt/ci.js
  • Loading branch information
sandgraham authored and VladimirMilenko committed Apr 2, 2020
1 parent 31f557c commit 4163ee6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vrt/ci.js
Expand Up @@ -23,7 +23,7 @@ const {
} = process.env;

// Derive some useful constants
const SNAPSHOT_BRANCH = `${BUILDKITE_BRANCH}--vrt`;
const SNAPSHOT_BRANCH = `${sanitizeBranchName(BUILDKITE_BRANCH)}--vrt`;
const [
ORIGINAL_REPOSITORY_OWNER,
ORIGINAL_REPOSITORY_NAME,
Expand Down Expand Up @@ -346,6 +346,12 @@ function getRepositoryOwnerAndNameFromURL(url) {
return [owner, name];
}

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, '-');
}

function log(message) {
console.log(`❖ VRT: ${message}`);
}

0 comments on commit 4163ee6

Please sign in to comment.