GitHub
What the Wardn GitHub App can read and write, what appears on your pull requests, and how to see and pause what GitHub sends.
The GitHub App is how Wardn reads your private repositories and learns about pushes and pull requests. This page is the App from your side: what you grant when you install it, what Wardn writes back to GitHub, and how to see what GitHub sent. To connect a repository, see Connect a source. The person who runs Wardn creates the App once; that is GitHub App under Self-hosting.
Install it
Anyone with integration:manage (Owners and Admins) installs the App on their GitHub account or organization:
- Open Settings › Integrations and choose GitHub, then Connect GitHub.
- GitHub asks which account to install on and which repositories the App may read: All repositories or Selected repositories.
- GitHub sends you back to Wardn, which records the installation and the repositories it covers.
An installation belongs to one Wardn organization only. If the page says "This server is not set up as a GitHub App", the person who runs Wardn has not created the App yet.
The GitHub card lists each installation: the account, whether it covers All repositories or Selected repositories (and which), and Suspended when GitHub has suspended it. It also lists the Source repos that apps in Wardn are built from. To change which repositories an installation covers, use the installation's settings in GitHub. GitHub sends you back to Wardn when you save, and Wardn records the new list.
api() { curl -fsS -H "Authorization: Bearer $WARDN_TOKEN" -H 'Content-Type: application/json' "$@"; }
api "$WARDN_API_URL/api/v1/github/installations" # each installation, its repositories and its credentialsRefWhat you grant
The App asks for the least it needs. Everything it reads and writes is listed here.
| Permission | Access | Wardn uses it to |
|---|---|---|
| Contents | Read | Read manifests, charts and the branch a snapshot was rendered from. |
| Metadata | Read | Required by GitHub for every App. Also reads whether a branch is protected. |
| Pull requests | Read and write | Find the pull requests to build previews for, and keep one comment on each. Without write access previews still work, only without the comment. |
| Commit statuses | Read and write | Post the wardn/preview status on a pull request's head commit. |
| Deployments | Read and write | Optional. Give a preview a GitHub deployment and its View deployment button. |
The App subscribes to the Push and Pull request events.
Wardn does not write to repository contents, open pull requests, push branches or use GitHub Checks. The only things it writes are commit statuses, deployments and one comment per preview on its pull request. Agent-made pull requests and approvals by code owners are planned.
What Wardn does with a push
GitHub sends a push event within seconds. Wardn verifies its signature, accepts each delivery once, then asks the repository where the branch points now, rather than trusting the event, and renders one snapshot of the commit. A webhook that never arrives costs a minute, not a deploy: every tracked branch is also checked about once a minute. Connect a source has the detail.
Three more things come from GitHub:
- Who pushed, the commit and the branch, recorded on every snapshot so you can trace a running snapshot back to a commit.
- Whether the branch is protected. The production protected-branch rule reads this from GitHub when no branch is named. For repositories that are not on GitHub it is unknown.
- Commits between two snapshots, for the Commits list on a snapshot's page. Other git hosts cannot list them.
Pull request previews
With previews on for a deployment (see Pull request previews), each pull request gets a deployment of its own. Wardn reports on it in GitHub in three ways, each with its own switch in the deployment's preview settings, all on by default:
| Switch | What appears on the pull request |
|---|---|
githubStatus | A commit status named wardn/preview on the head commit, with a Details link to the preview's page in Wardn when the server knows its public address, otherwise to the preview's URL. |
githubDeployment | A GitHub deployment per commit, in the transient environment preview/pr-<number>, which gives the pull request a View deployment button once the preview has a URL. |
githubComment | One comment on the pull request, found again by a hidden marker and edited in place, so two quick pushes edit the same comment. It shows the status (building, live, failed with its reason and a log link, or removed), the commit, the preview link, the Wardn link and when it last changed. |
The status moves through these states:
| State | Description shown |
|---|---|
| Pending | "Building the preview.", "Applying the preview." or "Waiting for a guardrail to be judged; trying again." |
| Success | "The preview is live." When the pull request closes: "The preview was removed." |
| Failure | "The preview was held for review before it could be applied." or "The preview could not be applied" with the reason. |
The GitHub deployment is in_progress while building and applying, success once live (its environment URL is the preview URL and its log URL is the preview's page in Wardn), failure if it fails, and inactive when the preview is removed and the pull request closed.
If you did not give the App Deployments: read and write, previews keep working and keep their commit status; Wardn logs the refusal once per installation. When you add the permission later, each installation must accept it in GitHub before it applies. With githubDeployment off, Wardn never calls the Deployments API.
The comment needs Pull requests: read and write. If the installation has not accepted it, Wardn logs that once per installation and carries on with the status and deployment. GitHub answering with a server error or a rate limit is retried with backoff and never makes a second comment. With githubComment off, Wardn never calls the comments API.
A pull request from a fork gets no preview, because its manifests would run in your cluster. A maintainer can allow one by adding the deployment's fork label to the pull request (wardn:preview unless the deployment sets another); removing the label removes the preview. Fork code is rendered in the same sandbox as any other, so add the label only after reading the change.
Add wardn/preview as a required status check on the target branch if you want a pull request not to merge before its preview is healthy. It is reported as failure when the preview cannot be applied.
See and pause what GitHub sends
Open Settings › Integrations › GitHub. Recent deliveries lists the last two weeks of webhook deliveries: the event, the repository, the result and how long Wardn took.
| Result | Meaning |
|---|---|
accepted | The delivery was queued for work. |
ignored | A replay of a delivery Wardn already took. |
failed | Wardn could not queue it. GitHub keeps its own copy under the App's advanced settings, where you can redeliver. |
The integration's state is connected, degraded (its last deliveries failed), paused or not_configured. Pause makes Wardn ignore the provider's events until you resume it, for all installations of the organization at once. Nothing is uninstalled, and pushes still arrive through the one-minute check.
api "$WARDN_API_URL/api/v1/integrations"
api "$WARDN_API_URL/api/v1/integrations/github/deliveries?result=failed"
api -X POST "$WARDN_API_URL/api/v1/integrations/github/pause"
api -X POST "$WARDN_API_URL/api/v1/integrations/github/resume"When something does not work
| Symptom | Check |
|---|---|
| A push does not start a render. | Recent deliveries: is the push there? If not, the webhook is not reaching Wardn; the one-minute check still picks it up. Confirm the repository is covered by the installation. |
| "This server is not set up as a GitHub App". | The server has no App settings. See GitHub App. |
| Installation shown as Suspended. | Unsuspend it in GitHub. Wardn cannot read the repositories until then. |
No wardn/preview status on a pull request. | Previews are on for the deployment, the status switch is on, the App has Commit statuses and the pull request is not from a fork without the label. |
| No comment on the pull request. | The App lacks Pull requests: read and write, githubComment is off, or the pull request is a fork without the label. |
| No View deployment button. | The App lacks Deployments access, githubDeployment is off, or the preview has no URL (the deployment has no preview domain). |
| Production deploys are blocked as "not from the protected branch". | The branch is not protected in GitHub. See Guardrails. |
Permissions
| Action | Permission |
|---|---|
| Install, list installations, pause, resume, see deliveries | integration:manage |
| Turn previews and their GitHub switches on for a deployment | deployment:manage |
Next
Notifications
The inbox behind the bell, what lands in it, and how to choose what you are told by email, in Slack and in a digest.
Git hosts
Connect GitLab, Bitbucket Cloud, Azure DevOps, GitHub Enterprise Server and Gitea or Forgejo, cloud or self-hosted, so pushes, previews, commit statuses and merge request comments work as they do on GitHub.