feat: add --org flag to create command for selected_orgs visibility#21
Open
feat: add --org flag to create command for selected_orgs visibility#21
Conversation
Agent-Logs-Url: https://github.com/github/gh-runtime-cli/sessions/c4a2f3ca-48ed-460e-bbfe-1b434d765262 Co-authored-by: jasonrclark <130504+jasonrclark@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
jasonrclark
April 6, 2026 23:26
View session
…ription Agent-Logs-Url: https://github.com/github/gh-runtime-cli/sessions/135170e4-bbe2-4865-9684-7d9f0cdcdb12 Co-authored-by: jasonrclark <130504+jasonrclark@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds support for scoping gh runtime create visibility to “selected_orgs” by introducing an --org/-o flag and wiring it through to the API request as organization_login.
Changes:
- Added
--org/-oflag and request payload fieldorganization_login. - Added validation rules tying
--orgto--visibility=selected_orgs. - Added/updated unit tests to cover the new validation and request body behavior.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Promotes stretchr/testify from indirect to direct dependency (used by tests). |
| cmd/create.go | Registers --org/-o, validates flag combinations, and sends organization_login in the create request. |
| cmd/create_test.go | Adds tests for invalid/valid --org + --visibility=selected_orgs combinations and request body assertions. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 0
…te command Agent-Logs-Url: https://github.com/github/gh-runtime-cli/sessions/ad4273fd-ac84-4153-bbcb-051d8a348e37 Co-authored-by: jasonrclark <130504+jasonrclark@users.noreply.github.com>
nicodes
approved these changes
Apr 7, 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.
Part of https://github.com/github/spark/issues/817
Summary
Adds
--orgargument to thegh runtime createcommand to support the upcoming GitHub APIorganization_loginparameter.Changes
orgfield tocreateCmdFlagsstructOrganizationLoginfield (JSON:organization_login) tocreateReqstruct--org/-oflag registration with descriptive help text--visibilityflag description to includeselected_orgsExampleto document the new flagrunCreate:--orgis rejected unless--visibility=selected_orgs--orgis required when--visibility=selected_orgsorgvalue asorganization_loginin the API request bodyTests
TestRunCreate_OrgWithoutSelectedOrgsVisibility– verifies error when--orgis used with a non-selected_orgsvisibilityTestRunCreate_SelectedOrgsVisibilityWithoutOrg– verifies error when--visibility=selected_orgsis used without--orgTestRunCreate_WithOrgAndSelectedOrgsVisibility– verifies successful request with correctorganization_loginin the bodyAll existing tests continue to pass.