diff --git a/lib/branch.js b/lib/branch.js index 948ea738..8ac17ddc 100644 --- a/lib/branch.js +++ b/lib/branch.js @@ -1,6 +1,6 @@ exports.isBranchNameValid = (branchName) => (!!branchName.match( - /^(core|feature|fix|hotfix|asset|rework|documentation|mobsuccessbot|dependabot)\/([a-z][a-z0-9.-]*)$/ + /^(core|feature|fix|hotfix|asset|rework|documentation|mobsuccessbot|dependabot)\/([a-z][a-z0-9._-]*)$/ ) || !!branchName.match(/^(mobsuccessbot)\/([a-z0-9_\-@./_-]*)$/) || !!branchName.match(/^(dependabot)\/([a-z][a-zA-Z0-9./_-]*)$/) || diff --git a/lib/branch.test.js b/lib/branch.test.js index fcba3be1..72156295 100644 --- a/lib/branch.test.js +++ b/lib/branch.test.js @@ -20,6 +20,7 @@ describe("branch", () => { expect(isBranchNameValid("foo/foo-bar")).toBe(false); expect(isBranchNameValid("core/foo--bar")).toBe(true); expect(isBranchNameValid("core/foo--bar--z")).toBe(true); + expect(isBranchNameValid("feature/branch-name_from_linear")).toBe(true); }); test("recognize invalid branch names", () => { expect(isBranchNameValid("core/npm_and_yarn/axios-0.21.1")).toBe(false);