A machine or bot user is a GitHub user that is not used by humans, instead it is exclusively used for automation. This is the best way to access a private repository: you create a machine user, add a public SSH key to the user, and then provide the user read access to the repository.
Adding the machine user to your repository:
Create a new GitHub user account, one that will serve as the machine user.
Go to your repository on GitHub and select the Settings tab.
-
On the left side menu, select Collaborators & teams.
Scroll down to the Collaborators window.
In the search input field, search for the username of your newly created account.
Click Add Collaborator.
-
Change the user permission to Read.
By default, the invited collaborator’s permission is Write. You can keep it that way, of course, but a Read permission is enough for Bitrise.
Adding the SSH key to the machine user:
In order for Bitrise to be able to use the machine user to access your repository, you must add the same SSH key to the machine user and the app on Bitrise.
When adding a new app:
Start the process of adding your app on Bitrise.
-
When prompted to setup repository access, you can choose either Automatic or Add own SSH:
If you choose Add own SSH, you can generate your own SSH keypair. Provide the generated SSH key for the app and add the public key to your GitHub machine user.
If you choose Automatic, click I need to when asked if you need to use an additional private repository. Copy the SSH public key to your GitHub machine user.
Finish the process.
If your app already exists:
Open your app on Bitrise.
Go to the Settings tab.
Scroll down to SSH settings.
Click the Click to show SSH public key button.
Copy the SSH public key and add it to your GitHub machine user.