File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ lockComment: >
3535 This thread has been automatically locked because it has not had recent
3636 activity. Please open a new issue for related bugs and link to relevant
3737 comments in this thread.
38+ # Issues or pull requests with these labels will not be locked
39+ # exemptLabels:
40+ # - no-locking
3841# Limit to only `issues` or `pulls`
3942# only: issues
4043```
Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ lockComment: >
2222 This thread has been automatically locked because it has not had recent
2323 activity. Please open a new issue for related bugs and link to relevant
2424 comments in this thread.
25+ # Issues or pull requests with these labels will not be locked
26+ # exemptLabels:
27+ # - no-locking
2528# Limit to only `issues` or `pulls`
2629# only: issues
2730```
Original file line number Diff line number Diff line change @@ -40,16 +40,22 @@ module.exports = class Lock {
4040
4141 search ( ) {
4242 const { owner, repo} = this . context . repo ( ) ;
43- const { daysUntilLock, only} = this . config ;
43+ const { exemptLabels , daysUntilLock, only} = this . config ;
4444 const timestamp = this . since ( daysUntilLock )
4545 . toISOString ( )
4646 . replace ( / \. \d { 3 } \w $ / , '' ) ;
4747
4848 let query = `repo:${ owner } /${ repo } is:closed updated:<${ timestamp } ` ;
49+ if ( exemptLabels && exemptLabels . length ) {
50+ const queryPart = exemptLabels
51+ . map ( label => `-label:"${ label } "` )
52+ . join ( ' ' ) ;
53+ query += ` ${ queryPart } ` ;
54+ }
4955 if ( only === 'issues' ) {
50- query += ` is:issue` ;
56+ query += ' is:issue' ;
5157 } else if ( only === 'pulls' ) {
52- query += ` is:pr` ;
58+ query += ' is:pr' ;
5359 }
5460
5561 this . logger . info ( `[${ owner } /${ repo } ] Searching` ) ;
You can’t perform that action at this time.
0 commit comments