How to switch from Deploy Keys token to Apps

hi all, I am having some trouble understanding the basic ideas behind Github Apps.

let’s talk by example.

what I currently do
I have several repos under my account.
for just a single repo, I have added a deploy key with R/W access.
I can handle my repo from any pc using that deploy key, having full access to the repo but without having access to my other repos.
I can commit to the repo and commits will show up as coming from my username.

what I’d like to do
I’d like to switch from Deploy Keys to apps in order to experiment with Github Apps.
I’d like to be able to accomplish the same, that is, push commits from any pc to a single repo, possibly showing this difference by the fact that commits are pushed as a bot (e.g. my-test-bot) and not my own user.
I have some trouble understanding how to accomplish this.
is there an easy guide I could follow, starting with the basics, not with webhooks and runners (which I understand because I routinely use Github Actions but are not what I’d like to do now)?

thanks!

Hi, hi @piramiday!

Happy to be of assistance here, but I might not fully grasp your end goal.

Currently, you have a deploy key which resides on your machines that you develop on.

However you would like to create a GitHub OAuth app, for similar purposes. That is, to manipulate your repositories from a web UI that you’ve crafted, which would utilize not a Deploy Key, but an OAuth key.

You also mentioned Actions, which can be used to apply CI logic to your deployment process, but are unique to GitHub applications.

I suppose the best starting place would be here:

https://docs.github.com/en/developers/apps/building-oauth-apps

Though, I’d love some clarification on whether or not I fully understood your concern and your goal.

I managed to do what I was trying to do. it’s weird, but it works.

instead of creating a deploy key, I have created a Github App and I used an installation token to be able to interact with the repo as the bot, not as my username.
in such a way issues and PRs created by the bot are nicely marked as being linked to a bot.
commits are showed as being pushed by the bot even though at present Github is not adding a “bot” label on those (but they might in the future).

sorry for the weird question.
you can safely delete this thread since it’s more confusing than helpful for most people.

1 Like