Setting up the Integration
Integrating Devin into your GitHub allows Devin to access your repos, create pull requests, read and respond to your PR comments, and more. This lets Devin be a true collaborator on your engineering team.Create a Service Account for Devin
- Within your GitHub Enterprise, create a new GitHub account for Devin to use. This is important to ensure all of Devin’s access and usage can be properly tracked and managed.
- Add the newly created service account to all relevant GitHub organizations as a Member. Verify that the account has access to all of the repositories that Devin is expected to access.
Generate a Personal Access Token for Devin
- While logged into the service account, click on the profile picture in the upper-right corner, then click Settings.
- In the left sidebar, click Developer settings.
- In the left sidebar, under Personal access tokens, click Fine-grained tokens.
- Click Generate new token.
- Add the Token name and Expiration.
Note: When the token expires, Devin will immediately lose all access to GitHub and a new token will need to be created. - Under Resource owner, select the correct organization. If the organization does not appear, check that the enterprise and organization have enabled the use of fine-grained personal access tokens (see Common Issues: Enabling Personal Access Tokens).
- Under Repository access, select which repositories you want Devin to work with. Tokens always include read-only access to all public repositories on GitHub.
- Make sure the token has the following permissions which are required for Devin to work properly:
Permission | Access level | Description |
---|---|---|
Contents | Read and write | Allow Devin to contribute to the codebase |
Issues | Read and write | Allow Devin to open new issues |
Metadata | Read only | Allow Devin to view crucial metadata about a repository such as who owns it |
Pull requests | Read and write | Allow Devin to create new PRs |
- Click Generate Token and save the token that is displayed.
Note: Admin approval may be needed depending on your GitHub settings. - To validate that the token has all the necessary access and permissions, create and push a test branch on your local machine to a repository in the organization.
- Once the token has been generated and tested, reach out to your Cognition point of contact to finish the setup process. If you are not currently working directly with our team, reach out to enterprise@cognition.ai.
Common Issue: Enabling Personal Access Tokens
Common Issue: Enabling Personal Access Tokens
If you’re not seeing the correct organization under “Resource owner”, make sure that the enterprise and organization have enabled the use of fine-grained personal access tokens.
Enabling in Enterprise Settings
Only Enterprise Admins will be able to update these settings. Make sure that personal access tokens are also enabled in the specific organization settings.- In the top-right corner of GitHub Enterprise Server, click your profile picture, then click Enterprise settings.
- At the top of the page, click Policies.
- Under Policies, click Personal access tokens.
- Select the Fine-grained tokens tab.
- Under Fine-grained personal access tokens, enable access.
- Click Save.
Enabling in Organization Settings
Only Organization Admins will be able to update these settings. Make sure that personal access tokens are also enabled in the enterprise settings.- In the upper-right corner of GitHub, click your profile picture, then click Organizations.
- Next to the organization, click Settings.
- In the left sidebar, under Personal access tokens, click Settings.
- Select the Fine-grained tokens tab.
- Under Fine-grained personal access tokens, enable access for your organization.
- Click Save.
Using Devin with the GitHub Integration
Now that GitHub is integrated, you can configure which Devin sub-organizations have access to each repository (see Enterprise GitHub Permissions) Once the integration is set up, you can go to the Devin web application and you are now able to @mention any repository in your prompt! If you are using a repository for the first time, we recommend going through the development environment setup process in the onboarding flow to ensure that Devin has the most accurate and up to date information about working with your codebase.Devin will automatically respond to any PR comments as long as the session has not been archived
Security Considerations
Some additional information regarding Devin’s permissions in GitHub:- We recommend enabling branch protections on master to ensure checks are enforced before Devin can merge any changes.
- If Devin is connected to your organization’s GitHub account then it will have the same permissions for any user with access to the GitHub and Devin organizations.
- Devin will not mirror the permissions of the user running a session with Devin, it will retain the permissions granted at the org-level.
- Devin cannot create new repos in your GitHub account.