deployments:write can report the resources it deployed for a commit, such as a preview site, with their status and links. Entire attaches them to the commit’s Change, whose detail lists them with a ready count, such as 3 of 4 ready. The Deployments section on entire.com is still being built. The Deployments API only reports deployments: it doesn’t create them, and it never blocks a merge.
Deployments are on Entire’s v0 API. Field names may change before the contract is final.
What you need
deployments:write, on your plugin’s installation token. Ask Entire to add it when you register your plugin. It grants nothing else.checks:write,contentspermissions and user tokens don’t grant it.- The project’s acceptance. Adding the permission to your plugin doesn’t grant it to existing installations. It stays pending until a project manager accepts it. Until then, writes for that project’s repositories answer
403, so keep reporting there through check runs or trail comments.
api_base_url, under /api/v0 rather than /api/v1, with the installation’s access token as bearer token. Use the public repo_… repository ID and the full 40- or 64-character commit SHA. The Go SDK does the minting and routing for you.
Report a resource
external_updated_at to when the state changed on your side, in UTC, not to when you send the request. Keep each resource’s key the same across updates and across commits.
The response has one result per resource, in request order:
outcome is created, updated, unchanged or ignored_stale. deployment is the stored state, whether or not your write applied.
Keep it current
- Report
queued, thenin_progress, thencompletedwith aconclusion. - Report
inactivewhen you remove the deployed resource, such as a torn-down preview, and omitconclusion, so its links stop being offered. - Retries are safe. Entire orders writes by
external_updated_at, so an older report never overwrites a newer one. At an equal time, a write never moves a resource back to an earlier status, so a late retry can’t revive a torn-down preview. Reuse the sameexternal_updated_atwhen you retry. - Report each commit you deploy. A Change shows only the deployments on its head commit, never an earlier commit’s.
Read your reports
GET on the same URL returns your plugin’s current report for each key on that commit, ordered by key. It returns only your plugin’s deployments:
?per_page= (1 to 100, default 30). While the response has a next_cursor, pass it back unchanged as ?cursor= for the next page.
Errors
Errors areapplication/problem+json. Branch on code, not on the status.
With the Go SDK
AddDeployments: plugin.Write to Config.Permissions, matching your registration. inst.Deployments then reports and reads deployments:
Status: plugin.Inactive.
inst.Deployments.List returns one page of your current reports, and inst.Deployments.All iterates over all of them. A refusal is an *entire.HTTPError: check it with entire.HasCode, for example entire.HasCode(err, entire.CodeForbidden) for a project that hasn’t accepted deployments:write yet.