def are_files_in_repo(self, files: List[str], hook: HookDetails) -> bool:
try:
for file in files:
self.__gh_client.get_repo(hook.repository).get_file_contents(path=file, ref=hook.sha if hook.sha else hook.branch)
except github.GithubException as gh_exc:
logging.exception(f"Exception when looking for file {file} in repo {hook.repository} at ref {hook.sha}/{hook.branch} (Exc: {gh_exc})")
return False
return True
评论列表
文章目录