Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ docker build -t checking_repo .
docker run -v $(pwd)/output:/app/output checking_repo [--invites] [--commites] [--etc...] -t <insert_token> -l <insert_list> -o ./output/res.csv
```

## Как создать токен:
1. Заходим в настройки профиля github
2. Листаем вниз и выбираем пункт Developer settings
3. Нажимаем на вкладку Personal access tokens, в выпадающем списке выбираем Tokens(classic)
4. Нажимаем на кнопку Generate new token, в выпадающем окне выбираем Generate new token(classic)
5. Мы попадаем в настройки токена. Вписываем название токена, выбираем длительность действия токена, ставим галочки на нужные вам права, например - (Repo, workflow, user)
6. Нажимаем Generate token, сохраняем код токена и пользуемся.

## Запуск приложения:
1. Логирование commits
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def parse_args():
help=(
'Path to the file containing the list of repositories. '
'Repositories should be separated by a line break. '
'Names should be in the format <organization or owner>/<name> '
'Names must be in the format <organization or owner>/<name> '
),
)
parser.add_argument(
Expand Down
6 changes: 6 additions & 0 deletions src/git_logger.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import re
from time import sleep
import logging
import traceback
Expand Down Expand Up @@ -35,6 +36,11 @@ def get_tokens_from_file(tokens_path: str) -> list[str]:
def get_repos_from_file(repos_path: str) -> list[str]:
with open(repos_path, 'r') as file:
list_repos = [x for x in file.read().split('\n') if x]
pattern = re.compile(r'[0-9A-Za-z-_\.]+/[0-9A-Za-z-_\.]+')
for repo in list_repos:
if not pattern.fullmatch(repo):
logging.error('Repository name must be in the format <organization or owner>/<name>')
exit(1)

return list_repos

Expand Down