From 049d9398332008b9745d8e918a481859fb4c726d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Sat, 24 Aug 2024 00:42:18 -0300 Subject: [PATCH] Usar get_org_installation() si falla get_repo_installation() --- main.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 3428df3..e4d0bb8 100644 --- a/main.py +++ b/main.py @@ -234,16 +234,12 @@ def post(): gh = github.GithubIntegration( cfg.github_app_id, open(cfg.github_app_keyfile).read() ) - auth_token = cfg.github_token.get_secret_value() try: installation = gh.get_installation(alu_repo.owner, alu_repo.name) - auth = gh.get_access_token(installation.id) - auth_token = auth.token except github.UnknownObjectException: - # Probablemente el repositorio no existe todavĂ­a. Usamos el antiguo token - # hasta que resolvamos - # https://github.com/PyGithub/PyGithub/issues/1730#issuecomment-739111283. - pass + installation = gh.get_org_installation(alu_repo.owner) + auth = gh.get_access_token(installation.id) + auth_token = auth.token repo_sync = RepoSync( alu_repo=alu_repo, auth_token=auth_token,