[Feat] Github App Deployment#1112
Merged
RichardAnderson merged 3 commits intoMay 22, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class site deployment support for GitHub App–backed source controls by switching Git operations to HTTPS with short-lived installation tokens provided via a git credential helper, while also tightening source control scoping and addressing a few deployment/SSH-related edge cases uncovered during implementation.
Changes:
- Implement GitHub App deployment path: installation token minting/caching, injection via
GIT_HTTP_TOKEN, and git credential helper setup (clone/fetch/set-remote). - Tighten
source_controlvalidation to be server-scoped (user + project) and allow GitHub App source controls to be used for sites. - Add GitHub App push webhook handling to trigger deployments asynchronously; fix isolated-user SSH key provisioning and remove sensitive script logging.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Feature/SitesTest.php | Updates expectations and factories to include user scoping and new git quoting behavior. |
| tests/Feature/GithubAppTest.php | Adds/updates feature tests covering GitHub App site create/update, env vars token injection, and push webhook deploy trigger. |
| tests/Feature/API/SitesTest.php | Aligns API site creation tests with user-scoped SourceControl validation. |
| resources/views/ssh/site/check-user-exists.blade.php | Removes unused SSH template after isolation behavior change. |
| resources/views/ssh/os/create-isolated-user.blade.php | Makes isolated user creation idempotent and ensures server public key is present in authorized_keys. |
| resources/views/ssh/git/set-remote.blade.php | Adds remote rewrite + credential helper toggle for token-based deployments. |
| resources/views/ssh/git/fetch-origin.blade.php | Adjusts path handling for safer shell usage. |
| resources/views/ssh/git/clone.blade.php | Adds token-based clone flow using credential helper; adjusts escaping/quoting in clone script. |
| resources/views/ssh/git/checkout.blade.php | Adjusts escaping/quoting for branch/path. |
| app/SSH/OS/OS.php | Escapes exported runScript variables; removes logging of full scripts; passes server public key into isolated-user creation. |
| app/SSH/OS/Git.php | Routes clone/fetch/set-remote through token-aware env injection and shell-escaped args. |
| app/SourceControlProviders/GithubApp.php | Implements required deployment surface (repo URL, hooks/keys no-ops) and installation access token minting/caching. |
| app/SiteTypes/PHPSite.php | Updates site validation to require server-scoped source control rules. |
| app/SiteTypes/NodeJS.php | Updates site validation to require server-scoped source control rules. |
| app/SiteTypes/MiseNodeJS.php | Updates site validation to require server-scoped source control rules. |
| app/SiteTypes/MiseBun.php | Updates site validation to require server-scoped source control rules. |
| app/SiteTypes/AbstractSiteType.php | Skips deploy key for GitHub App sites; always runs isolated-user creation to reassert keys/permissions; removes user-existence helper. |
| app/Providers/SourceControlServiceProvider.php | Enables GitHub App provider for site usage. |
| app/Models/SourceControl.php | Changes site validation rules to be server-scoped (provider usable + user/project constraints). |
| app/Models/Site.php | Adds GIT_HTTP_TOKEN to environment variables for GitHub App–backed sites. |
| app/Jobs/Site/TriggerDeployFromWebhookJob.php | New job to trigger deployments from GitHub App push webhooks. |
| app/Jobs/Site/DeployJob.php | Injects environment variables into modern deployment SSH step. |
| app/Http/Controllers/API/GithubAppWebhookController.php | Routes push events to the new handler action. |
| app/Actions/Site/UpdateSourceControl.php | Server-scoped validation; cleans up deploy keys/hooks on swap; rewrites git remote URL. |
| app/Actions/GithubApp/HandlePushWebhook.php | New action to map push payloads to matching sites and enqueue deploy triggers. |
Member
|
Approved |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements site deployments for GitHub App via short-lived installation tokens injected through a git credential helper, plus a handful of pre-existing-bug fixes uncovered along the way.
Implemented a git credential helper - clone and pull operations now run through a credential.helper for GitHub App deployments, token is per-repo and the token only ever lives in env at exec-time, never on disk. Token is only valid for 1h. Using a git credential helper here allows existing deployment scripts authenticate for any required commands during the deployment without changes.