Repository navigation
Link Project to Repository Command #7849
Description
Activity
@dsanders11 This seems like a solid idea and a workflow we should support. I looked at
updateProjectV2mutation and I don't see any way to link a repository, can you share the docs where you saw this was possible?Reacted by David Babenko-Sanders- addedmore-info-neededMore info needed from user/contributorMore info needed from user/contributorand removedneeds-triageneeds to be reviewedneeds to be reviewed
on Aug 17, 2023 I looked at
updateProjectV2mutation and I don't see any way to link a repository, can you share the docs where you saw this was possible?Whoops, that was a copy-and-paste error on my end, I meant to refer to
linkProjectV2ToRepository. I'll update the issue description.There's also
linkProjectV2ToTeamand unlink equivalents for both of those, so that should probably be handled for completeness.Maybe it should just be options added to
gh project editas your earlier comment mentioned - maybe similar to adding/removing reviewers withgh pr edit? Maybe options like--link-to-repository,--link-to-team, and--unlink-from-repositoryand--unlink-from-team.Just some off the cuff thoughts, haven't thought much about what form it takes, just that the functionality would be useful. 🙂
@dsanders11 Thanks for the clarification. I agree, now that we know it is available from the API, that this would be a useful feature. As for where the feature belongs, I have thought a bit more about it and I think a dedicated
project linkcommand makes more sense then shoehorning this feature intoproject edit. A dedicated command can also support linking to a team as well as a repository as you mentioned.Reacted by David Babenko-Sanders- addedhelp wantedContributions welcomeContributions welcomeand removedmore-info-neededMore info needed from user/contributorMore info needed from user/contributor
on Aug 21, 2023 - addedgh-projectrelating to the gh project commandrelating to the gh project command
on Oct 3, 2023
Describe the feature or problem you’d like to solve
I'd like to be able to link a project to a repository from the CLI.
Proposed solution
A new command,
gh project link [<number>] [<repository>]which links the project to a repository. Uses thelinkProjectV2ToRepositoryGraphQL mutation for implementation.Will allow users to link a project to a repository from the CLI