Skip to content

Link Project to Repository Command #7849

Description

@dsanders11

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 the linkProjectV2ToRepository GraphQL mutation for implementation.

Will allow users to link a project to a repository from the CLI

Activity

  1. samcoe commented on Aug 17, 2023

    @samcoe
    Contributor

    @dsanders11 This seems like a solid idea and a workflow we should support. I looked at updateProjectV2 mutation and I don't see any way to link a repository, can you share the docs where you saw this was possible?

  2. added
    more-info-neededMore info needed from user/contributor
    and removed on Aug 17, 2023
  3. dsanders11 commented on Aug 17, 2023

    @dsanders11
    Author

    I looked at updateProjectV2 mutation 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 linkProjectV2ToTeam and unlink equivalents for both of those, so that should probably be handled for completeness.

    Maybe it should just be options added to gh project edit as your earlier comment mentioned - maybe similar to adding/removing reviewers with gh pr edit? Maybe options like --link-to-repository, --link-to-team, and --unlink-from-repository and --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. 🙂

  4. samcoe commented on Aug 21, 2023

    @samcoe
    Contributor

    @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 link command makes more sense then shoehorning this feature into project edit. A dedicated command can also support linking to a team as well as a repository as you mentioned.

  5. added and removed
    more-info-neededMore info needed from user/contributor
    on Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-projectrelating to the gh project commandhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions