File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def parse_args():
63
63
help = (
64
64
'Path to the file containing the list of repositories. '
65
65
'Repositories should be separated by a line break. '
66
- 'Names should be in the format <organization or owner>/<name> '
66
+ 'Names must be in the format <organization or owner>/<name> '
67
67
),
68
68
)
69
69
parser .add_argument (
Original file line number Diff line number Diff line change
1
+ import re
1
2
from time import sleep
2
3
import logging
3
4
import traceback
@@ -35,6 +36,11 @@ def get_tokens_from_file(tokens_path: str) -> list[str]:
35
36
def get_repos_from_file (repos_path : str ) -> list [str ]:
36
37
with open (repos_path , 'r' ) as file :
37
38
list_repos = [x for x in file .read ().split ('\n ' ) if x ]
39
+ for repo in list_repos :
40
+ pattern = r'[0-9A-Za-z-_\.]+/[0-9A-Za-z-_\.]+'
41
+ if not re .fullmatch (pattern , repo ):
42
+ print ('Names must be in the format <organization or owner>/<name>' )
43
+ exit (1 )
38
44
39
45
return list_repos
40
46
You can’t perform that action at this time.
0 commit comments