@@ -41280,7 +41280,7 @@ const run = async (params) => {
4128041280
4128141281 if (alreadyPublished(pullRequest)) {
4128241282 core.info('Skipping execution because stats are published already');
41283- return;
41283+ return null ;
4128441284 }
4128541285
4128641286 const pulls = await getPulls({
@@ -41306,7 +41306,7 @@ const run = async (params) => {
4130641306 core.debug('Stats table built successfully');
4130741307
4130841308 const content = buildComment({
41309- table, periodLength, org, repos,
41309+ table, periodLength, org, repos, isSponsor: params.isSponsor,
4131041310 });
4131141311 core.debug(`Commit content built successfully: ${content}`);
4131241312
@@ -41318,15 +41318,21 @@ const run = async (params) => {
4131841318 await core.setOutput('resultsMd', content);
4131941319 await core.setOutput('resultsJson', whParams);
4132041320
41321- if (!pullRequestId) return;
41322- await postComment({
41323- octokit,
41324- content,
41325- publishAs,
41326- pullRequestId,
41327- currentBody: pullRequest.body,
41328- });
41329- core.debug('Posted comment successfully');
41321+ if (pullRequestId) {
41322+ await postComment({
41323+ octokit,
41324+ content,
41325+ publishAs,
41326+ pullRequestId,
41327+ currentBody: pullRequest.body,
41328+ });
41329+ core.debug('Posted comment successfully');
41330+ }
41331+
41332+ return {
41333+ reviewers,
41334+ pullRequest,
41335+ };
4133041336};
4133141337
4133241338module.exports = async (params) => {
@@ -41340,8 +41346,8 @@ module.exports = async (params) => {
4134041346
4134141347 try {
4134241348 telemetry.start(params);
41343- await run({ ...params, isSponsor, octokit });
41344- telemetry.success();
41349+ const results = await run({ ...params, isSponsor, octokit });
41350+ telemetry.success(results );
4134541351 } catch (error) {
4134641352 telemetry.error(error);
4134741353 throw error;
@@ -41392,6 +41398,9 @@ const PR_BY_ID_QUERY = `
4139241398 url
4139341399 body
4139441400 number
41401+ author {
41402+ login
41403+ }
4139541404 comments(last: 100) {
4139641405 nodes {
4139741406 author {
@@ -41703,11 +41712,13 @@ module.exports = ({
4170341712 table,
4170441713 org,
4170541714 repos,
41715+ isSponsor,
4170641716 periodLength,
4170741717}) => {
4170841718 const sources = buildSources({ buildGithubLink, org, repos });
4170941719 const message = t('table.subtitle', { sources, count: periodLength });
41710- return `## ${t('table.title')}\n${message}:\n${table}`;
41720+ const footer = isSponsor ? '' : `\n${t('table.footer')}`;
41721+ return `## ${t('table.title')}\n${message}:\n${table}${footer}`;
4171141722};
4171241723
4171341724
@@ -43360,11 +43371,12 @@ class Telemetry {
4336043371 });
4336143372 }
4336243373
43363- success() {
43374+ success(results ) {
4336443375 if (!this.useTelemetry) return;
4336543376 sendSuccess({
4336643377 timeMs: new Date() - this.startDate,
4336743378 tracker: this.tracker,
43379+ ...(results || {}),
4336843380 });
4336943381 }
4337043382}
@@ -43437,14 +43449,25 @@ module.exports = ({
4343743449/***/ 7513:
4343843450/***/ ((module) => {
4343943451
43440- module.exports = ({ tracker, timeMs }) => {
43452+ module.exports = ({
43453+ timeMs,
43454+ tracker,
43455+ pullRequest,
43456+ reviewers: reviewersInput,
43457+ }) => {
4344143458 const timeSec = Math.floor(timeMs / 1000);
4344243459 const timeMin = Math.floor(timeMs / 60000);
43460+ const prAuthor = pullRequest?.author?.login;
43461+ const reviewers = (reviewersInput || []).map((r) => r?.author?.login);
43462+ const reviewersCount = reviewers.length;
4344343463
4344443464 tracker.track('success', {
4344543465 timeMs,
4344643466 timeSec,
4344743467 timeMin,
43468+ prAuthor,
43469+ reviewers,
43470+ reviewersCount,
4344843471 });
4344943472};
4345043473
@@ -48032,7 +48055,7 @@ module.exports = JSON.parse('{"name":"mixpanel","description":"A simple server-s
4803248055/***/ ((module) => {
4803348056
4803448057"use strict";
48035- module.exports = JSON.parse('{"name":"pull-request-stats","version":"2.13 .0","description":"Github action to print relevant stats about Pull Request reviewers","main":"dist/index.js","type":"commonjs","scripts":{"build":"eslint src && ncc build src/index.js -o dist -a","test":"jest","lint":"eslint ./"},"keywords":[],"author":"Manuel de la Torre","license":"MIT","jest":{"testEnvironment":"node","testMatch":["**/?(*.)+(spec|test).[jt]s?(x)"]},"dependencies":{"@actions/core":"^1.10.1","@actions/github":"^6.0.0","axios":"^1.6.7","humanize-duration":"^3.31.0","i18n-js":"^3.9.2","jsurl":"^0.1.5","lodash.get":"^4.4.2","markdown-table":"^2.0.0","mixpanel":"^0.18.0"},"devDependencies":{"@vercel/ncc":"^0.38.1","eslint":"^8.56.0","eslint-config-airbnb-base":"^15.0.0","eslint-plugin-import":"^2.29.1","eslint-plugin-jest":"^27.6.3","jest":"^29.7.0"},"funding":"https://github.com/sponsors/manuelmhtr","packageManager":"yarn@4.1.0"}');
48058+ module.exports = JSON.parse('{"name":"pull-request-stats","version":"2.14 .0","description":"Github action to print relevant stats about Pull Request reviewers","main":"dist/index.js","type":"commonjs","scripts":{"build":"eslint src && ncc build src/index.js -o dist -a","test":"jest","lint":"eslint ./"},"keywords":[],"author":"Manuel de la Torre","license":"MIT","jest":{"testEnvironment":"node","testMatch":["**/?(*.)+(spec|test).[jt]s?(x)"]},"dependencies":{"@actions/core":"^1.10.1","@actions/github":"^6.0.0","axios":"^1.6.7","humanize-duration":"^3.31.0","i18n-js":"^3.9.2","jsurl":"^0.1.5","lodash.get":"^4.4.2","markdown-table":"^2.0.0","mixpanel":"^0.18.0"},"devDependencies":{"@vercel/ncc":"^0.38.1","eslint":"^8.56.0","eslint-config-airbnb-base":"^15.0.0","eslint-plugin-import":"^2.29.1","eslint-plugin-jest":"^27.6.3","jest":"^29.7.0"},"funding":"https://github.com/sponsors/manuelmhtr","packageManager":"yarn@4.1.0"}');
4803648059
4803748060/***/ }),
4803848061
@@ -48056,7 +48079,7 @@ module.exports = JSON.parse('{"slack":{"logs":{"notConfigured":"Slack integratio
4805648079/***/ ((module) => {
4805748080
4805848081"use strict";
48059- module.exports = JSON.parse('{"title":"Pull reviewers stats","icon":"https://s3.amazonaws.com/manuelmhtr.assets/flowwer/logo/logo-1024px.png","subtitle":{"one":"Stats of the last day for {{sources}}","other":"Stats of the last {{count}} days for {{sources}}"},"sources":{"separator":", ","fullList":"{{firsts}} and {{last}}","andOthers":"{{firsts}} and {{count}} others"},"columns":{"avatar":"","username":"User","timeToReview":"Time to review","totalReviews":"Total reviews","totalComments":"Total comments"}}');
48082+ module.exports = JSON.parse('{"title":"Pull reviewers stats","icon":"https://s3.amazonaws.com/manuelmhtr.assets/flowwer/logo/logo-1024px.png","subtitle":{"one":"Stats of the last day for {{sources}}","other":"Stats of the last {{count}} days for {{sources}}"},"sources":{"separator":", ","fullList":"{{firsts}} and {{last}}","andOthers":"{{firsts}} and {{count}} others"},"columns":{"avatar":"","username":"User","timeToReview":"Time to review","totalReviews":"Total reviews","totalComments":"Total comments"},"footer":"<sup>⚡️ [Pull request stats](https://bit.ly/pull-request-stats)</sup>" }');
4806048083
4806148084/***/ })
4806248085
0 commit comments