Skip to content

Conversation

@gabriel-samfira
Copy link
Member

@gabriel-samfira gabriel-samfira commented Mar 1, 2024

This change adds the ability to use GitHub Apps to authenticate against the GitHub API. This gives us a larger quota for API requests (15k vs 5k for PATs).

Also, each GitHub App has its own quota, whereas PATs share the same user quota.

To use it, define a new credentials config section with the following contents:

[[github]]
  # This is an arbitrary name
  name = "github_app"
  description = "github app with access to example org/repo"
  # This can be "pat" or "app". Based on this, the HTTP client will either be instantiated
  # using a PAT or an app installation.
  auth_type = "app"
  [github.app]
    # You get this after creating the app. This needs to be changed
    app_id = 1
    private_key_path = "/etc/garm/yourAppName.2024-03-01.private-key.pem"
    # This is the installation ID in your org or repo. This needs to be changed.
    installation_id = 99

Fixes: #214

@gabriel-samfira gabriel-samfira force-pushed the add-github-app-support branch 2 times, most recently from 0a4c497 to d261101 Compare March 1, 2024 19:21
@gabriel-samfira
Copy link
Member Author

@Hdom give it a try if you have the time.

This change adds the ability to use GitHub Apps to authenticate against the
GitHub API. This gives us a larger quota for API requests (15k vs 5k for PATs).

Also, each GitHub App has its own quota, whereas PATs share the same user quota.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
@gabriel-samfira gabriel-samfira force-pushed the add-github-app-support branch from d261101 to cbb2134 Compare March 1, 2024 19:47
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
@gabriel-samfira gabriel-samfira force-pushed the add-github-app-support branch 2 times, most recently from 686cbc5 to a84286c Compare March 2, 2024 20:24
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
@gabriel-samfira gabriel-samfira force-pushed the add-github-app-support branch from a84286c to d734286 Compare March 2, 2024 20:42
@gabriel-samfira gabriel-samfira merged commit 1b11c68 into cloudbase:main Mar 4, 2024
@gabriel-samfira gabriel-samfira deleted the add-github-app-support branch March 4, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for github apps

1 participant