GitHub and Forgejo
Connect a repository once: every push deploys, every pull request gets its own URL. Forgejo deploy on every push.
Connect a repository once, and you stop deploying by hand. Every push to the branch you chose builds and goes live on your domains. Every pull request builds too, on an address of its own, so a change can be looked at before it is merged — and the address is posted back to the pull request.
Connecting
- In the console, open your project → Settings → GitHub.
- Choose Connect GitHub. GitHub asks which repositories to grant — pick only the ones you want deployed. You can change that list later, on GitHub, without coming back here.
- Pick a repository, confirm the branch that serves production, and decide whether pull requests get previews.
Private repositories work: each build clones with a token that nesly asks GitHub for at build time and that expires within the hour. nesly never asks for your GitHub password and never holds a personal access token.
GitLab
Connecting a GitLab project is not open on nesly yet. A public GitLab repository deploys by URL, once: nesly deploy https://gitlab.com/group/project.
Forgejo
Forgejo works for repositories on the Forgejo instance this platform is connected to, and the same steps fit Gitea and Codeberg (they speak the same API). Every push to the connected branch deploys to production, and the result — pending, then success or failed — is written onto the pushed commit. Pull-request previews are not available for Forgejo yet.
- In the console, open your project → Settings → the git section →Forgejo. The switch is shown only when this platform has Forgejo configured.
- Choose Connect Forgejo and authorize in your browser. From the terminal:
nesly git statusprints the same link. - Pick a repository and confirm the branch — or
nesly git connect --provider forgejo owner/repo.
nesly registers the push webhook on the repository itself, so you needadmin rights on it; the list offers only repositories where that holds. Connecting again never adds a second webhook.
Public repositories need none of this: nesly deploy https://codeberg.org/owner/repo deploys one by URL, once (the page URLs a browser shows, .../src/branch/<branch>, work too).
What nesly asks Forgejo for
Forgejo does not offer narrower OAuth scopes: an authorized application acts with your account's rights. nesly uses that for exactly four things — reading who you are, listing the repositories you administer, registering the push webhook, and writing the build result onto a commit — plus cloning your private repositories to build them. It holds a token that expires and is renewed, never your password.
Revoke it any time under your Forgejo account → Settings → Applications; or disconnect in the console, which deletes the stored token and unlinks the repositories that used it. The webhook stays on the repository (the token that could remove it is gone): delete it under the repository's Settings → Webhooks. A push that arrives for a repository that is no longer connected is answered and ignored.
Pushes whose commit message contains [skip ci] (or the other tokens above), branch deletions and tag pushes do not deploy. Every delivery is signed by Forgejo (X-Forgejo-Signature, an HMAC of the body); a request with a wrong or missing signature gets 401 and nothing is read from it.
What happens on each event
The table is for GitHub; on Forgejo only the first and fourth rows apply.
| On GitHub | Here | What that means |
|---|---|---|
| Push to the connected branch | Production deploy | Your domains serve the new build once it is ready. The previous deployment stays reachable at its own URL. |
| Pull request opened or updated | Preview deploy | A build of that branch on its own address, commented on the pull request. |
| Pull request closed or merged | Preview stopped | The preview URL stops answering and the workload is removed. |
| Push to any other branch | Nothing | Only the connected branch deploys to production. |
| Pull request from a fork | Nothing | A fork's code is written by someone with no write access to the repository. Building it would run that code with your environment variables, under your name. |
| Commit or PR title contains [skip ci] | Nothing | Also [ci skip], [no ci], [skip actions], [skip deploy] (and the swapped forms). The token may sit on any line of the commit message. |
Previews
A preview is a full deployment of the pull request's branch, built with the same commands production is built with. It gets its own permanent address and it never takes over your project's domains, however green it is.
A preview URL is public, so a preview never gets your production database. The first preview of a project with a Postgres, MySQL, MS SQL, MongoDB, Valkey or bucket addon gets a database of its own, empty, and every later preview of the project uses that one; it goes when the addon or the project does. Your own variables carry over. To point previews somewhere else, setnesly env set DATABASE_URL=... --env preview; to use production's on purpose,nesly env share DATABASE_URL --with preview.
A preview address is public by default — it is meant to be pasted into a pull request and opened by whoever is reviewing. When the work is not for everyone, close it withnesly protect preview set --password ...: the address then asks for that password before it serves anything. Your published site is never affected. For CI, which has no browser, nesly protect preview token mints a token to send as theX-Nesly-Preview-Bypass header.
The pull request carries one comment, edited on every push rather than repeated, and the commit carries a status you can see from the pull request's checks. When the pull request is closed or merged, the preview is taken down.
What nesly asks GitHub for
| Contents | Read | Clone the repository to build it. |
| Metadata | Read | List the repositories you granted, so you can pick one. |
| Commit statuses | Write | The green check next to your commit. |
| Pull requests | Write | One comment with the preview URL, updated in place. |
That is the whole list. No access to your organisation's members, your other repositories, your Actions secrets, or anything you did not grant. Everything is revocable from your own GitHub settings, and revoking it there unlinks the projects here.
From the terminal
Deployments made by a push look like any other deployment, and say which pull request they belong to:
nesly ls
nesly inspect dep_... # Preview of: pull request #7
nesly logs # the build output of the last deploymentHow the build itself is configured — the directory, the commands, the output — is on the builds page, and is the same for pushes, pull requests and nesly deploy.
When a push does not deploy
- The branch is not the connected one. Only the branch you chose deploys to production; change it in the console.
- The pull request comes from a fork. Deliberate — see the table above.
- The repository was removed from the installation. Add it again on GitHub; the project reconnects on the next push.
- GitHub keeps a delivery log for the app under your repository's settings. Every delivery gets an answer saying what was done and, when nothing was, why.