Skip to main content

Listing the deploy history

api.GetApplicationDeployments(appID) returns [][]squarecloud.Deploymentone inner slice per deploy. Every event in a group shares the same ID (the commit SHA-1, 40 hex chars) and walks through the lifecycle states: pending → clone → commit → restarting → success | error.
Branch is only populated on the "clone" event, and Files (Added, Removed, Modified) only on the "commit" event.

Inspecting the current configuration

api.GetApplicationCurrentDeployment(appID) returns a squarecloud.DeploymentCurrent with the GitHub App linkage currently configured.
api.LinkApplicationGithubApp(appID, repoName, branch) links a GitHub repository to the application via the official GitHub App.
To remove the link:
LinkApplicationGithubApp and UnlinkApplicationGithubApp require a session token (JWT) as your credential — plain API keys are not accepted by these endpoints. Pass it with rest.WithToken(sessionToken) or build the client with it.

Linking via the legacy webhook flow

api.PostApplicationDeployWebhook(appID, accessToken) registers a GitHub Personal Access Token (ghp_* or github_pat_*) and returns the webhook URL to configure on GitHub.
Pass the token "@" to remove the configured webhook.