File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Changelog
22All notable changes to this project will be documented in this file.
33
4+ ## [ 2.15.2] - 2024-12-01
5+ ### Fixed
6+ - Prevents ` githubToken ` and ` personalToken ` from be included in the JSON output.
7+
48## [ 2.15.1] - 2024-07-19
59### Changes
610- Fix on "Build with" link.
Original file line number Diff line number Diff line change 11{
22 "name" : " pull-request-stats" ,
3- "version" : " 2.15.1 " ,
3+ "version" : " 2.15.2 " ,
44 "description" : " Github action to print relevant stats about Pull Request reviewers" ,
55 "main" : " dist/index.js" ,
66 "type" : " commonjs" ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const {
1111 postComment,
1212 getReviewers,
1313 buildComment,
14+ buildJsonOutput,
1415 setUpReviewers,
1516 checkSponsorship,
1617 alreadyPublished,
@@ -72,12 +73,13 @@ const run = async (params) => {
7273 core . debug ( `Commit content built successfully: ${ content } ` ) ;
7374
7475 const whParams = { ...params , core, reviewers } ;
76+ const jsonOutput = buildJsonOutput ( { ...params , reviewers } ) ;
7577 await postWebhook ( whParams ) ;
7678 await postSlackMessage ( { ...whParams , pullRequest } ) ;
7779 await postTeamsMessage ( { ...whParams , pullRequest } ) ;
7880 await postSummary ( { core, content } ) ;
7981 await core . setOutput ( 'resultsMd' , content ) ;
80- await core . setOutput ( 'resultsJson' , whParams ) ;
82+ await core . setOutput ( 'resultsJson' , jsonOutput ) ;
8183
8284 if ( pullRequestId ) {
8385 await postComment ( {
Original file line number Diff line number Diff line change 1+ const buildJsonOutput = require ( '../buildJsonOutput' ) ;
2+
3+ describe ( 'Interactors | .alreadyPublished' , ( ) => {
4+ const params = {
5+ githubToken : 'GITHUB_TOKEN' ,
6+ personalToken : 'PERSONAL_TOKEN' ,
7+ reviewers : 'REVIEWERS' ,
8+ foo : 'BAR' ,
9+ } ;
10+
11+ it ( 'removes tokens' , ( ) => {
12+ const results = buildJsonOutput ( params ) ;
13+ expect ( results ) . not . toHaveProperty ( 'githubToken' ) ;
14+ expect ( results ) . not . toHaveProperty ( 'personalToken' ) ;
15+ } ) ;
16+
17+ it ( 'keeps the other properties' , ( ) => {
18+ const results = buildJsonOutput ( params ) ;
19+ const { githubToken, personalToken, ...other } = params ;
20+ expect ( results ) . toEqual ( expect . objectContaining ( {
21+ ...other ,
22+ } ) ) ;
23+ } ) ;
24+ } ) ;
Original file line number Diff line number Diff line change 1+ module . exports = ( params ) => {
2+ const { githubToken, personalToken, ...other } = params ;
3+ return other ;
4+ } ;
Original file line number Diff line number Diff line change 11const alreadyPublished = require ( './alreadyPublished' ) ;
22const buildTable = require ( './buildTable' ) ;
33const buildComment = require ( './buildComment' ) ;
4+ const buildJsonOutput = require ( './buildJsonOutput' ) ;
45const checkSponsorship = require ( './checkSponsorship' ) ;
56const getPulls = require ( './getPulls' ) ;
67const getReviewers = require ( './getReviewers' ) ;
@@ -15,6 +16,7 @@ module.exports = {
1516 alreadyPublished,
1617 buildTable,
1718 buildComment,
19+ buildJsonOutput,
1820 checkSponsorship,
1921 getPulls,
2022 getReviewers,
You can’t perform that action at this time.
0 commit comments