File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -654,6 +654,12 @@ function remainingApiCalls(response) {
654
654
// URL.parse is too recent to use
655
655
656
656
function parseRepo ( url ) {
657
+ // First check that this is a github repo
658
+ const re =
659
+ / ^ h t t p s : \/ \/ ( w w w \. ) ? g i t h u b \. c o m \/ [ A - Z a - z 0 - 9 _ . - ] + \/ [ A - Z a - z 0 - 9 _ . - ] + \/ ? $ / ;
660
+ if ( ! url . match ( re ) ) {
661
+ throw new Error ( `The url ${ url } is not a GitHub repo` ) ;
662
+ }
657
663
const chunks = url . split ( "/" ) ;
658
664
const user = chunks [ 3 ] ;
659
665
const repo = chunks [ 4 ] ;
Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ class PullRequest {
259
259
if ( ! run . args . sprt . state ) {
260
260
throw new Error ( "Pull requests can only contain finished tests" ) ;
261
261
}
262
- if ( run . args . new_tc && ! run . args . tc != ! run . args . new_tc ) {
262
+ if ( run . args . new_tc && run . args . tc != run . args . new_tc ) {
263
263
throw new Error ( "Pull requests cannot contain time odds tests" ) ;
264
264
}
265
265
this . runIdCache [ runId ] = run ;
@@ -299,7 +299,7 @@ class PullRequest {
299
299
}
300
300
branch = run . args . new_tag ;
301
301
tests_repo = run . args . tests_repo ;
302
- latest = runs . start_time ;
302
+ latest = run . start_time ;
303
303
}
304
304
}
305
305
let user , repo ;
@@ -410,11 +410,7 @@ class PullRequest {
410
410
} ;
411
411
let body = await this . renderBody ( token ) ;
412
412
body = body . replaceAll ( "<br>" , "\n" ) ;
413
- if ( this . title ) {
414
- options . title = escapeHtml ( this . title ) ;
415
- } else {
416
- options . title = await this . renderTitle ( token ) ;
417
- }
413
+ options . title = await this . renderTitle ( token ) ;
418
414
options . body = body ;
419
415
// TODO Incorporate user
420
416
if ( this . numberCache [ userData . branch ] ) {
Original file line number Diff line number Diff line change 68
68
submitBtn.textContent ="Submit";
69
69
}
70
70
} catch(e) {
71
- console.log(e);
71
+ const text = await processError(e);
72
+ alertError(text);
73
+ console.error(text);
72
74
}
73
75
previewTab.addEventListener("click", async () => {
74
76
PR.title = titleElt.value;
You can’t perform that action at this time.
0 commit comments