Skip to content

Commit

Permalink
Usar get_org_installation() si falla get_repo_installation()
Browse files Browse the repository at this point in the history
  • Loading branch information
dato committed Aug 24, 2024
1 parent 0e3dcda commit 049d939
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 049d939

Please sign in to comment.