-
-
Notifications
You must be signed in to change notification settings - Fork 25.3k
show stats for specific organizations or repositories #4290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
martin-mfg
wants to merge
29
commits into
anuraghazra:master
Choose a base branch
from
martin-mfg:repo_filter_v2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
@martin-mfg is attempting to deploy a commit to the github readme stats Team on Vercel. A member of the Team first needs to authorize it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
card-i18n
Card text translations.
documentation
Improvements or additions to documentation.
repo-card
Issues related to the pin/repo card.
stats-card
Feature, Enhancement, Fixes related to stats the stats card.
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.
This PR adds new functionality to show contribution stats for specific repositories and organizations.
GitHub Stats Card changes
Add optional parameters
&repos=userA/repoA,orgB/repoB
and&owners=userC,orgD
to filter the user's contributions by repo or organization.GitHub Extra Pins (Repo Card) changes
Add optional parameter
&show=prs_authored,prs_commented,prs_reviewed,issues_authored,issues_commented
to display the user's contribution to the pinned repository.Supporting changes
Add 5 new options to
show
: prs_authored, prs_commented, prs_reviewed, issues_authored and issues_commented.They are similar to some existing options, e.g.
issues_authored
is similar toissues
. The difference is how these values are fetched - via GraphQL or via REST API. The pre-existing items use GraphQL, but filtering by repository or owner works better via REST API.Add some style options to GitHub Extra Pins (Repo Card) which existed already for GitHub Stats card: card_width, show_icons, line_height, text_bold, number_format and show. They only affect the style of the new options introduced in this PR.
update readme with new descriptions and examples
allow user-specified card_width parameter to be smaller than internally computed minimum width. If the user explicitly asks for a specific display width, there's no need to prevent this. Especially with the new stats options I found smaller widths helpful.
For GitHub Extra Pins (Repo Card), the
repo
parameter can now optionally include the repo owner. This is useful for showing user A's contributions to user B's repository.Make the new individual stats clickable links. Links lead to the list of relevant contributions, e.g. a list of the user's created PRs (in a specific repository). However, GitHub turns the whole image into a link, so this feature isn't too useful. People have to click the image first, which opens it in a new tab, then in the new tab again click the specific stat that they are interested in. Alternatively, if the generated images are embedded on another site than GitHub, the new links are directly clickable.
minor adjustments of rendering logic to support new features, more informative error messages, etc.
Demo
anuraghazra's contributions to github-readme-stats:

anurag's contributions to razorpay:

A version of github-readme-stats including my changes is available here for testing.
A fork with my changes is available at https://github.com/martin-mfg/github-readme-stats/tree/readme-test. Feel free to fork and host your own version while this PR is being reviewed.
Motivation
As contributor in another Open Source project, I wanted to have an overview of my own contributions to that specific project. And I wanted to display this overview on my GitHub profile page. I think other Open Source contributors might find this useful too.