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():
6363 help = (
6464 'Path to the file containing the list of repositories. '
6565 '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> '
6767 ),
6868 )
6969 parser .add_argument (
Original file line number Diff line number Diff line change 1+ import re
12from time import sleep
23import logging
34import traceback
@@ -35,6 +36,11 @@ def get_tokens_from_file(tokens_path: str) -> list[str]:
3536def get_repos_from_file (repos_path : str ) -> list [str ]:
3637 with open (repos_path , 'r' ) as file :
3738 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 )
3844
3945 return list_repos
4046
You can’t perform that action at this time.
0 commit comments