fixed build_source validation in custom git trigger
This commit is contained in:
parent
6ed5235dfd
commit
3fb4d0750b
2 changed files with 19 additions and 1 deletions
|
@ -70,8 +70,9 @@ export class ManageTriggerComponent implements OnInit {
|
|||
}
|
||||
|
||||
public checkBuildSource(buildSource: string): void {
|
||||
const buildSourceRegExp = new RegExp(/(((http|https):\/\/)(.+)|\w+@(.+):(.+))/, 'i');
|
||||
try {
|
||||
this.local.selectedRepository.full_name = buildSource.split(':')[1].replace('.git', '');
|
||||
this.local.selectedRepository.full_name = buildSourceRegExp.test(buildSource) ? buildSource : null;
|
||||
} catch (error) {
|
||||
this.local.selectedRepository.full_name = null;
|
||||
}
|
||||
|
|
Reference in a new issue