Search code examples
github

Quick access to 'invited' or 'watched' repository


When using GitHub, I frequently run into the needs of accessing a repository I'm invited to.

But those repos aren't automatically placed under my 'Your repositories' tab, and even if I use the 'watch' function, I still can't find a place where I can access that repo.

It seems the only way to quickly access a repo in GitHub is to 'star' it?


Solution

  • I'm not aware of any such view in the GitHub web UI, but you can get the list using GitHub's API… either by using the REST endpoint List repositories for the authenticated user (setting the affiliations parameter to a value that doesn't include owner, such as collaborator,organization_member), or using the GraphQL API with a query such as this one:

    You can try it in the explorer here: https://docs.github.com/en/graphql/overview/explorer

    query ReposNotOwned($cursor: String) {
      viewer {
        repositories(
          affiliations: [COLLABORATOR, ORGANIZATION_MEMBER]
          first: 100
          orderBy: {field: UPDATED_AT, direction: DESC}
          after: $cursor
        ) {
          totalCount
          pageInfo {
            hasNextPage
            endCursor
          }
          nodes {
            name
            owner {
              login
            }
            stargazerCount
            createdAt
            pushedAt
            updatedAt
            url
          }
        }
      }
    }
    

    It seems the only way to quickly access a repo in GitHub is to 'star' it?

    GitHub also has a repository "list" feature (announcement here). It's still in public beta (at the time I composed this answer). This should be more convenient than a global list of starred repositories.