@@ -46,27 +46,33 @@ var RE_CO_AUTHORED_BY = /co-authored-by/i;
46
46
function extractContributors ( commits ) {
47
47
var mentions ;
48
48
var mention ;
49
+ var author ;
49
50
var out ;
50
51
var i ;
51
52
var j ;
52
53
53
54
out = [ ] ;
54
55
for ( i = 0 ; i < commits . length ; i ++ ) {
56
+ author = replace ( commits [ i ] . author , / \s * < [ ^ > ] + > \s * / , '' ) ;
55
57
if (
56
- ! contains ( out , commits [ i ] . author ) &&
57
- ! contains ( EXCLUDED_CONTRIBUTORS , commits [ i ] . author )
58
+ ! contains ( out , author ) &&
59
+ ! contains ( EXCLUDED_CONTRIBUTORS , author )
58
60
) {
59
- out . push ( commits [ i ] . author ) ;
61
+ out . push ( author ) ;
60
62
}
61
63
mentions = commits [ i ] . mentions || [ ] ;
62
64
for ( j = 0 ; j < mentions . length ; j ++ ) {
63
65
mention = mentions [ j ] ;
64
66
if (
65
- RE_CO_AUTHORED_BY . test ( mention . action ) &&
66
- ! contains ( out , mention . ref ) &&
67
- ! contains ( EXCLUDED_CONTRIBUTORS , mention . ref )
67
+ RE_CO_AUTHORED_BY . test ( mention . action )
68
68
) {
69
- out . push ( mention . ref ) ;
69
+ author = replace ( mention . ref , / \s * < [ ^ > ] + > \s * / , '' ) ;
70
+ if (
71
+ ! contains ( out , author ) &&
72
+ ! contains ( EXCLUDED_CONTRIBUTORS , author )
73
+ ) {
74
+ out . push ( author ) ;
75
+ }
70
76
}
71
77
}
72
78
}
@@ -77,15 +83,15 @@ function extractContributors( commits ) {
77
83
* Formats a contributor.
78
84
*
79
85
* @private
80
- * @param {string } contributor - contributor
86
+ * @param {string } contributor - contributor name
81
87
* @returns {string } formatted contributor
82
88
*
83
89
* @example
84
- * var out = formatContributor( 'Jane Doe <[email protected] > ' );
90
+ * var out = formatContributor( 'Jane Doe' );
85
91
* // returns '- Jane Doe'
86
92
*/
87
93
function formatContributor ( contributor ) {
88
- return '- ' + replace ( contributor , / \s * < [ ^ > ] + > \s * / , '' ) ;
94
+ return '- ' + contributor ;
89
95
}
90
96
91
97
0 commit comments