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(
1662
1662
// Recent GitHub Activity content between the comments
1663
1663
const readmeActivitySection = readmeContent . slice ( startIdx , endIdx ) ;
1664
1664
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
+ }
1666
1670
readmeContent . splice ( startIdx + idx , 0 , `${ idx + 1 } . ${ line } ` ) ;
1667
1671
} ) ;
1668
1672
tools . log . success ( "Wrote to README" ) ;
1669
1673
} else {
1670
1674
// It is likely that a newline is inserted after the <!--START_SECTION:activity--> comment (code formatter)
1671
1675
let count = 0 ;
1672
1676
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
+ }
1674
1682
if ( line !== "" ) {
1675
1683
readmeContent [ startIdx + idx ] = `${ count + 1 } . ${ content [ count ] } ` ;
1676
1684
count ++ ;
Original file line number Diff line number Diff line change @@ -187,15 +187,23 @@ Toolkit.run(
187
187
// Recent GitHub Activity content between the comments
188
188
const readmeActivitySection = readmeContent . slice ( startIdx , endIdx ) ;
189
189
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
+ }
191
195
readmeContent . splice ( startIdx + idx , 0 , `${ idx + 1 } . ${ line } ` ) ;
192
196
} ) ;
193
197
tools . log . success ( "Wrote to README" ) ;
194
198
} else {
195
199
// It is likely that a newline is inserted after the <!--START_SECTION:activity--> comment (code formatter)
196
200
let count = 0 ;
197
201
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
+ }
199
207
if ( line !== "" ) {
200
208
readmeContent [ startIdx + idx ] = `${ count + 1 } . ${ content [ count ] } ` ;
201
209
count ++ ;
You can’t perform that action at this time.
0 commit comments