mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-08-08 22:24:59 +00:00
Feature: Stats card: Show merged PRs count and percentage (#3003)
* Feature: Stats card: Show merged PRs count and percentage * dev * dev * renames
This commit is contained in:
@@ -54,6 +54,9 @@ const GRAPHQL_STATS_QUERY = `
|
||||
pullRequests(first: 1) {
|
||||
totalCount
|
||||
}
|
||||
mergedPullRequests: pullRequests(states: MERGED) {
|
||||
totalCount
|
||||
}
|
||||
openIssues: issues(states: OPEN) {
|
||||
totalCount
|
||||
}
|
||||
@@ -201,6 +204,8 @@ const fetchStats = async (
|
||||
const stats = {
|
||||
name: "",
|
||||
totalPRs: 0,
|
||||
totalPRsMerged: 0,
|
||||
mergedPRsPercentage: 0,
|
||||
totalReviews: 0,
|
||||
totalCommits: 0,
|
||||
totalIssues: 0,
|
||||
@@ -246,6 +251,9 @@ const fetchStats = async (
|
||||
}
|
||||
|
||||
stats.totalPRs = user.pullRequests.totalCount;
|
||||
stats.totalPRsMerged = user.mergedPullRequests.totalCount;
|
||||
stats.mergedPRsPercentage =
|
||||
(user.mergedPullRequests.totalCount / user.pullRequests.totalCount) * 100;
|
||||
stats.totalReviews =
|
||||
user.contributionsCollection.totalPullRequestReviewContributions;
|
||||
stats.totalIssues = user.openIssues.totalCount + user.closedIssues.totalCount;
|
||||
|
||||
Vendored
+2
@@ -18,6 +18,8 @@ export type RepositoryData = {
|
||||
export type StatsData = {
|
||||
name: string;
|
||||
totalPRs: number;
|
||||
totalPRsMerged: number;
|
||||
mergedPRsPercentage: number;
|
||||
totalReviews: number;
|
||||
totalCommits: number;
|
||||
totalIssues: number;
|
||||
|
||||
Reference in New Issue
Block a user