Github App installation into one repo

Hello,
I’m building a Github app and i was looking for a way to only restrict the installation of my app into a single repository.

My app can’t be installed into multiple repository… OR it would be very bad to allow my app to be installed on all the repository of the user.

Is there a way to add such a restriction?

Thank you.

:wave: @olivierodo!

There’s no way to restrict installation of your App to particular repositories via the App’s settings.

What’s the use-case for this? Is there a specific repository that your App should be installed on? Or is this something to do with billing your users for the number of repositories they install?

Hello,

Thank you for your reply, my app should help the user to setup some base practices for testing.
My plan was to push some files at the install step, however i realized that most of the people like to select all their repo (believe it or not… lol). Then since i don’t want to push files on all the user repositories, i think i will need change my flow…

Interesting. So you need some way for a user to indicate that they want your App to operate on a specific repository, even though they may have installed the App on all their repos. :thinking:

I’m guessing you already request repository contents write permission, so maybe the trigger for your App could be the user committing a configuration file in their repository (For example, GitHub Actions are initially triggered when you upload YAML files to the .github/workflows/ directory of a repo).

You could listen for the push or pull_request Webhook events to see if any of the pushed files contain your App’s configuration file.