Use GitHub with your agent
Connect GitHub so your agent can read and change your repositories, and keep its files in step with GitHub.
In this tutorial
Connect GitHub and your agent can read your repositories, open and comment on issues, look at pull requests and make changes for you. It's one of the most useful connections if you're building a product, and it takes about a minute.
Connect GitHub
- Open your agent and click Integrations.
- Find GitHub in Popular integrations, or search for it.
- Click Connect. GitHub's sign-in page opens in a new tab.
- Sign in and approve access. If GitHub asks which repositories to allow, choose the ones you want your agent to work on. You can change this later in GitHub.
- Go back to Heyron and wait for Connected.
Start a New chat and try a small, read-only request first.
Two ways your agent works with code
- Reading files and folders in a repository
- Opening, labelling and commenting on issues
- Reviewing pull requests
- Small, direct changes to files
- Cloning a repository into its workspace
- Running code, tests and scripts in its Terminal
- Larger changes across many files
- Pushing a branch for you to review
For anything bigger than a small edit, ask your agent to work on its own branch and open a pull request. Then you review the changes in GitHub before anything reaches your main branch.
When your agent says it can't clone a repository
Public repositories clone without any setup. Private ones need permission.
- First, check the repository is one you allowed when you connected GitHub. If not, update the repository access in GitHub's settings, or Disconnect and connect again.
- Ask your agent to use the GitHub connection to read the files, which often avoids cloning altogether.
- If it really needs a local copy of a private repository, ask it to explain what access it needs. Never paste your GitHub password into a chat.
If it's still stuck, open a ticket at /support with the repository name and the exact error.
When a file in GitHub doesn't match your agent's copy
Your agent's workspace and GitHub are two separate places. If you edit a file on GitHub, your agent's cloned copy doesn't change until it pulls the latest version, and the other way round.
When things look out of step:
- Ask your agent which branch it's on and when it last pulled.
- Ask it to pull the latest changes before it starts work.
- Ask it to push its branch when it's finished, and tell you the link.
Keep it safe
- Give your agent access only to the repositories it needs.
- Have it work on branches and open pull requests rather than changing your main branch directly.
- Never ask it to commit passwords, API keys or customer data. Keep those out of repositories entirely.
See approvals, privacy and safety for more on what to share with your agent.
Frequently asked questions
Can my agent push code to GitHub?
Yes, once GitHub is connected and it has access to that repository. Ask it to push to a new branch and open a pull request so you can review before merging.
Can it work on private repositories?
Yes, if you allowed those repositories when connecting GitHub. You can change which repositories it can see in your GitHub settings.
Why doesn't my agent see the change I just made on GitHub?
Its copy of the code lives on its own computer. Ask it to pull the latest changes first.
Can my agent run my code?
Yes. It has its own computer and a Terminal, so it can install dependencies, run tests and start scripts in its workspace.
How do I remove GitHub access?
Go to Integrations, then Connected, and click Disconnect next to GitHub.