File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -1662,15 +1662,23 @@ Toolkit.run(
16621662 // Recent GitHub Activity content between the comments
16631663 const readmeActivitySection = readmeContent . slice ( startIdx , endIdx ) ;
16641664 if ( ! readmeActivitySection . length ) {
1665- content . forEach ( ( line , idx ) => {
1665+ content . some ( ( line , idx ) => {
1666+ // User doesn't have 5 public events
1667+ if ( ! line ) {
1668+ return true ;
1669+ }
16661670 readmeContent . splice ( startIdx + idx , 0 , `${ idx + 1 } . ${ line } ` ) ;
16671671 } ) ;
16681672 tools . log . success ( "Wrote to README" ) ;
16691673 } else {
16701674 // It is likely that a newline is inserted after the <!--START_SECTION:activity--> comment (code formatter)
16711675 let count = 0 ;
16721676
1673- readmeActivitySection . forEach ( ( line , idx ) => {
1677+ readmeActivitySection . some ( ( line , idx ) => {
1678+ // User doesn't have 5 public events
1679+ if ( ! content [ count ] ) {
1680+ return true ;
1681+ }
16741682 if ( line !== "" ) {
16751683 readmeContent [ startIdx + idx ] = `${ count + 1 } . ${ content [ count ] } ` ;
16761684 count ++ ;
Original file line number Diff line number Diff line change @@ -187,15 +187,23 @@ Toolkit.run(
187187 // Recent GitHub Activity content between the comments
188188 const readmeActivitySection = readmeContent . slice ( startIdx , endIdx ) ;
189189 if ( ! readmeActivitySection . length ) {
190- content . forEach ( ( line , idx ) => {
190+ content . some ( ( line , idx ) => {
191+ // User doesn't have 5 public events
192+ if ( ! line ) {
193+ return true ;
194+ }
191195 readmeContent . splice ( startIdx + idx , 0 , `${ idx + 1 } . ${ line } ` ) ;
192196 } ) ;
193197 tools . log . success ( "Wrote to README" ) ;
194198 } else {
195199 // It is likely that a newline is inserted after the <!--START_SECTION:activity--> comment (code formatter)
196200 let count = 0 ;
197201
198- readmeActivitySection . forEach ( ( line , idx ) => {
202+ readmeActivitySection . some ( ( line , idx ) => {
203+ // User doesn't have 5 public events
204+ if ( ! content [ count ] ) {
205+ return true ;
206+ }
199207 if ( line !== "" ) {
200208 readmeContent [ startIdx + idx ] = `${ count + 1 } . ${ content [ count ] } ` ;
201209 count ++ ;
You can’t perform that action at this time.
0 commit comments