Skip to content

Commit

Permalink
Merge pull request #729 from camptocamp/fix-private-key
Browse files Browse the repository at this point in the history
Fix private key
  • Loading branch information
sbrunner authored Mar 1, 2025
2 parents 55cc347 + 7dbd4f8 commit 4fde7c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion github_app_geo_project/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class GithubApplication(NamedTuple):
integration: github.GithubIntegration
name: str
"""The application name"""
private_key: str


class GithubProject(NamedTuple):
Expand Down Expand Up @@ -92,7 +93,12 @@ def get_github_application(config: dict[str, Any], application_name: str) -> Git
config[f"application.{application_name}.github_app_id"],
private_key,
)
objects = GithubApplication(auth, github.GithubIntegration(auth=auth, retry=3), application_name)
objects = GithubApplication(
auth,
github.GithubIntegration(auth=auth, retry=3),
application_name,
private_key,
)

GITHUB_APPLICATIONS[application_name] = objects

Expand Down
2 changes: 1 addition & 1 deletion github_app_geo_project/module/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ async def git_clone(github_project: configuration.GithubProject, branch: str) ->
if not directory.exists():
directory.mkdir(parents=True)
async with aiofiles.open(directory / "id_rsa", "w", encoding="utf-8") as file:
await file.write(github_project.application.auth.private_key) # type: ignore[attr-defined]
await file.write(github_project.application.private_key)

command = [
"git",
Expand Down

0 comments on commit 4fde7c9

Please sign in to comment.