> For the complete documentation index, see [llms.txt](https://docs.canhav.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.canhav.com/ai-and-ide/github-sync.md).

# GitHub sync

**Studio+.** A workflow in your repository sends deployed contract addresses and ticked build steps to the project on every push and pull request, so nothing is retyped.

## Setup

The project page, Deployments, **GitHub setup** walks through it (M144):

1. Make a **write** project key (see [Project keys](https://docs.canhav.com/ai-and-ide/export-and-mcp.md#project-keys)); the card counts the live ones.
2. Download the **Sync workflow** and save it at `.github/workflows/canhav-sync.yml`. The download carries the project's chain id and the CanHav address, so no repository variables are needed.
3. Add the repository secret `CANHAV_PROJECT_KEY` with the write key as its value; the card links to the repository's secrets page when the project records its GitHub repository.
4. Push a commit. The card shows the last sync and the newest check run, with **Check again** to refresh.

The plain template is still `.github-templates/canhav-sync.yml` in the CanHav repository; that copy reads the variables `CANHAV_CHAIN_ID` (`46630` for Robinhood Chain testnet, `421614` for Arbitrum Sepolia) and `CANHAV_URL`.

## What it sends

* Every `CREATE` in `broadcast/<Script>.s.sol/<chainId>/run-latest.json` as a contract with the contract name as its label. Contracts merge into the Testnet contracts list by address; a known address keeps its row and gains the label when it had none.
* Every line `canhav: <stepId>` in the commit message or the pull request body ticks that build step with the commit as evidence. Step ids are the ones `get_build_steps` lists.

Writes ride the project's agent write mode: in propose mode they wait under Agent changes, in direct mode they land at once. Deployments shows the last sync as a line (commit, date, counts, whether it is waiting). Broadcasts for another chain are refused with a chain mismatch; the workflow logs the answer.

## Related

* [Markdown export and MCP](https://docs.canhav.com/ai-and-ide/export-and-mcp.md)
* [Studio+](https://docs.canhav.com/accounts/studio-plus.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.canhav.com/ai-and-ide/github-sync.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
