feat(cli): add cs deploy github command for PR deployments#178
Draft
alexvcodesphere wants to merge 1 commit intocodesphere-cloud:mainfrom
Draft
feat(cli): add cs deploy github command for PR deployments#178alexvcodesphere wants to merge 1 commit intocodesphere-cloud:mainfrom
alexvcodesphere wants to merge 1 commit intocodesphere-cloud:mainfrom
Conversation
28ebe7b to
8c13a29
Compare
Refactor the standalone gh-action-deploy binary into two layers: - pkg/deploy/: generic, provider-agnostic deployment engine (find, create, update, delete workspace + run pipeline) - cli/cmd/deploy_github.go: GitHub-specific subcommand that reads GitHub Actions env vars and delegates to pkg/deploy New commands: cs deploy - parent command for CI/CD deployments cs deploy github - GitHub Actions integration The generic engine in pkg/deploy/ can be reused by future providers (e.g. cs deploy gitlab). Signed-off-by: Alex <132889147+alexvcodesphere@users.noreply.github.com>
8c13a29 to
e780a86
Compare
This was referenced Feb 20, 2026
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.
Summary
Refactors the standalone
gh-action-deploybinary into two layers within the CLI:pkg/deploy/— generic, provider-agnostic deployment engine (find, create, update, delete workspace + run pipeline)cli/cmd/deploy_github.go— GitHub-specificcs deploy githubsubcommand that reads GitHub Actions env vars and delegates topkg/deployNew Commands
Files Changed
pkg/deploy/deploy.gopkg/deploy/mocks.godeploy.Clientpkg/deploy/deploy_test.gopkg/deploy/deploy_suite_test.gocli/cmd/deploy.gocs deployparent commandcli/cmd/deploy_github.gocs deploy githubsubcommandcli/cmd/root.goAddDeployCmdregistration.mockery.ymlpkg/deployfor mock generationDesign
The generic engine in
pkg/deploy/can be reused by future providers (e.g.cs deploy gitlab,cs deploy bitbucket).The GitHub subcommand auto-detects PR context from standard GitHub Actions environment variables (
GITHUB_EVENT_NAME,GITHUB_HEAD_REF,GITHUB_REPOSITORY, etc.) and creates, updates, or deletes workspaces accordingly.Verification
go fmt✅make lint✅ — 0 issuesmake build✅make test✅ — all pass including newpkg/deploytestscs deploy --help✅cs deploy github --help✅