File tree 3 files changed +15
-3
lines changed
3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ lockComment: >
35
35
This thread has been automatically locked because it has not had recent
36
36
activity. Please open a new issue for related bugs and link to relevant
37
37
comments in this thread.
38
+ # Issues or pull requests with these labels will not be locked
39
+ # exemptLabels:
40
+ # - no-locking
38
41
# Limit to only `issues` or `pulls`
39
42
# only: issues
40
43
```
Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ lockComment: >
22
22
This thread has been automatically locked because it has not had recent
23
23
activity. Please open a new issue for related bugs and link to relevant
24
24
comments in this thread.
25
+ # Issues or pull requests with these labels will not be locked
26
+ # exemptLabels:
27
+ # - no-locking
25
28
# Limit to only `issues` or `pulls`
26
29
# only: issues
27
30
```
Original file line number Diff line number Diff line change @@ -40,16 +40,22 @@ module.exports = class Lock {
40
40
41
41
search ( ) {
42
42
const { owner, repo} = this . context . repo ( ) ;
43
- const { daysUntilLock, only} = this . config ;
43
+ const { exemptLabels , daysUntilLock, only} = this . config ;
44
44
const timestamp = this . since ( daysUntilLock )
45
45
. toISOString ( )
46
46
. replace ( / \. \d { 3 } \w $ / , '' ) ;
47
47
48
48
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
+ }
49
55
if ( only === 'issues' ) {
50
- query += ` is:issue` ;
56
+ query += ' is:issue' ;
51
57
} else if ( only === 'pulls' ) {
52
- query += ` is:pr` ;
58
+ query += ' is:pr' ;
53
59
}
54
60
55
61
this . logger . info ( `[${ owner } /${ repo } ] Searching` ) ;
You can’t perform that action at this time.
0 commit comments