Skip to content

Commit

Permalink
fix(2952): Allow colon to be used in root directory (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
yk634 authored Nov 30, 2023
1 parent 2c89a71 commit a6e452d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/regex.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ module.exports = {
/^(?:(?:https:\/\/(?:[^@/:\s]+@)?)|git@|org-\d+@)+([^/:\s]+)(?:\/|:)([^/:\s]+)\/([^\s]+?)(?:\.git)(#[^: \s]* [^: \s]*|#[^: \s]+)?(:[^: \s]* [^: \s]*|:[^: \s]+)?$/,
// scmUri. For example: github.com:abc-123:master or bitbucket.org:{123}:master
// Optionally, can have rootDir. For example: github.com:abc-123:master:src/app/component
SCM_URI: /^([^:]+):([^:]+):([^:]+)(?::([^:]+))?$/,
SCM_URI: /^([^:]+):([^:]+):([^:]+)(?::(.*))?$/,
// SCM context. For example: github:github.com, gitlab:gitlab.mycompany.com
// First group: SCM plugin name (e.g. github)
// Second group: SCM host name (e.g. github.com)
Expand Down
2 changes: 1 addition & 1 deletion test/config/regex.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,12 +452,12 @@ describe('config regex', () => {
it('checks good scmUri', () => {
assert.isTrue(config.regex.SCM_URI.test('github.com:abc-123:master'));
assert.isTrue(config.regex.SCM_URI.test('github.com:abc-123:master:src/app/component'));
assert.isTrue(config.regex.SCM_URI.test('github.com:abc-123:master:a:b:c'));
assert.isTrue(config.regex.SCM_URI.test('bitbucket.org:d2lam/{123}:master'));
});

it('fails on bad scmUri', () => {
assert.isFalse(config.regex.SCM_URI.test('github.com:master'));
assert.isFalse(config.regex.SCM_URI.test('github.com:master:a:b:c'));
assert.isFalse(config.regex.SCM_URI.test('bitbucket.org:{123}'));
});
});
Expand Down

0 comments on commit a6e452d

Please sign in to comment.