GitHub
Install the Cofactor GitHub App so Cofactor can build your app, preview each pull request and post proof checks.
Connect GitHub so Cofactor can read your repositories. It then builds your app from them, gives pull requests a preview, and posts the cofactor / proofs check.
Connect GitHub
An organization admin does this once.
First, install the GitHub App.
Open Settings, then GitHub, and select Install GitHub App. Pick the account and the repositories to share.
An organization connects one GitHub installation, and an installation connects to one organization.
Then link each repository to its application. In the application, open the Code tab, select Link Your First Repository (Link Repository once one is linked) and pick the repository, or run the command.
cofactor application repo link --application <application id> --repo acme/store
An application that ships from several repositories can link each of them. The Code tab is not shown for MCP applications.
What the connection does
- Cofactor builds your app from the linked repositories. See Build from GitHub.
- Pull requests get a preview environment. See Preview environments.
- The
cofactor / proofscheck reports on pull requests that carry a proof block. See Release gates. - Cofactor can file its issues as GitHub issues. See Issues.
Check it worked
cofactor github connect
When GitHub is already connected, the command prints the connected account and the repositories Cofactor can read. In the app, Settings, GitHub lists them under Connected Repositories. Open a pull request on a linked repository and look for the preview deployment.
Fix a problem
| Symptom | What to check |
|---|---|
| Connected Repositories is empty | Select Manage and give the app access to your repositories on GitHub. |
| The app is on the wrong account | In Settings, GitHub, select Disconnect, then select Install GitHub App again and pick the right account. |
| No preview on a pull request | The branch needs a cofactor.sandbox.yaml, and pull requests from forks get no preview. See Preview environments. |
No cofactor / proofs check | The pull request description needs a proof block. On the PRs page, select Configure (admins only) and check that Post the proofs check is on. See Release gates. |
Go deeper
File issues as GitHub issues.
To file Cofactor issues as GitHub issues, an admin sets the repository that holds them with cofactor tickets config set --repo acme/tracker. Then cofactor tickets file <issue id> files one. When you connected several trackers and none is the default, add --provider github to both commands. cofactor tickets providers lists what each tracker supports.