19

I want to see all contributions I made to others on GitHub, but I do a ton of work in my own repositories so my contributions tab has my commits to my repo's overshadowing my contributions to others.

Would it be possible to basically see all my contributions exclude things like me starring other projects and contributions to my own repositories?

1

2 Answers 2

13

At the moment, there is no way to do this on github.com. The closest feature may be searching for pull requests and issues:

If you go in the Pull request tab and search for author:@me -user:@me, you will have a list of contributions (only pull requests and issues opened) made to repositories you do not own.

3
  • In addition, if you only want include contributions on public repositories, you can add is:public to the search query.
    – Koen.
    Commented Aug 13, 2019 at 22:51
  • That’s just PRs, not commits, though.
    – mirabilos
    Commented Jun 20 at 21:54
  • @mirabilos Absolutely, as per my first two sentences :-)
    – pchaigno
    Commented Jun 21 at 9:15
9

Update: Looks like this only returns:

A list of repositories that the user recently contributed to.

I guess "recently" means 1 year.

Also, it only selects up to 100 repositories at a time.


You can use the following GraphQL query in the API Explorer:

query getContributions($login: String!, $contributionTypes: [RepositoryContributionType]) {
  user(login: $login) {
    repositoriesContributedTo(contributionTypes: $contributionTypes, first: 100, includeUserRepositories: false, orderBy: {field: STARGAZERS, direction: DESC}) {
      pageInfo {
        hasNextPage
        endCursor
      }
      nodes {
        nameWithOwner
      }
    }
  }
}

Put this in query variables (replace login with your own user id) and then execute.

{
  "login": "zypA13510",
  "contributionTypes": [
    "COMMIT",
    "REPOSITORY"
  ]
}

The list of valid contributionTypes:

COMMIT
Created a commit

ISSUE
Created an issue

PULL_REQUEST
Created a pull request

REPOSITORY
Created the repository

PULL_REQUEST_REVIEW
Reviewed a pull request

1
  • Thanks for this. I was able to get the repo names by doing an HTTP POST to https://api.github.com/graphql with the following request body: {"query":"{user(login:\"your_github_username\") { repositoriesContributedTo(contributionTypes: [COMMIT, REPOSITORY], last: 100, includeUserRepositories: false) { pageInfo { startCursor hasPreviousPage } nodes { owner { login } name }}}}"}
    – Sal
    Commented Dec 15, 2020 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.