@@ -16,7 +16,7 @@ please consider contributing with
16
16
17
17
## Usage
18
18
19
- Create a ` lock.yml ` workflow file in the ` .github/workflows ` directory,
19
+ Create the ` lock.yml ` workflow file in the ` .github/workflows ` directory,
20
20
use one of the [ example workflows] ( #examples ) to get started.
21
21
22
22
### Inputs
@@ -28,44 +28,118 @@ The action can be configured using [input parameters](https://docs.github.com/en
28
28
- GitHub access token, value must be ` ${{ github.token }} ` or an encrypted
29
29
secret that contains a [ personal access token] ( #using-a-personal-access-token )
30
30
- Optional, defaults to ` ${{ github.token }} `
31
- - ** ` issue-lock- inactive-days ` **
31
+ - ** ` issue-inactive-days ` **
32
32
- Number of days of inactivity before a closed issue is locked
33
33
- Optional, defaults to ` 365 `
34
- - ** ` issue-exclude-created-before ` **
35
- - Do not lock issues created before a given timestamp,
34
+ - ** ` exclude-issue-created-before ` **
35
+ - Do not lock issues created before a given date,
36
+ value must follow ISO 8601, ignored
37
+ when ` exclude-issue-created-between ` is set
38
+ - Optional, defaults to ` '' `
39
+ - ** ` exclude-issue-created-after ` **
40
+ - Do not lock issues created after a given date,
41
+ value must follow ISO 8601, ignored
42
+ when ` exclude-issue-created-between ` is set
43
+ - Optional, defaults to ` '' `
44
+ - ** ` exclude-issue-created-between ` **
45
+ - Do not lock issues created in a given time interval,
36
46
value must follow ISO 8601
37
47
- Optional, defaults to ` '' `
38
- - ** ` issue-exclude-labels ` **
39
- - Do not lock issues with these labels, value must be
48
+ - ** ` exclude-issue-closed-before ` **
49
+ - Do not lock issues closed before a given date,
50
+ value must follow ISO 8601, ignored
51
+ when ` exclude-issue-closed-between ` is set
52
+ - Optional, defaults to ` '' `
53
+ - ** ` exclude-issue-closed-after ` **
54
+ - Do not lock issues closed after a given date,
55
+ value must follow ISO 8601, ignored
56
+ when ` exclude-issue-closed-between ` is set
57
+ - Optional, defaults to ` '' `
58
+ - ** ` exclude-issue-closed-between ` **
59
+ - Do not lock issues closed in a given time interval,
60
+ value must follow ISO 8601
61
+ - Optional, defaults to ` '' `
62
+ - ** ` include-any-issue-labels ` **
63
+ - Only lock issues with any of these labels, value must be
64
+ a comma separated list of labels or ` '' ` , ignored
65
+ when ` include-all-issue-labels ` is set
66
+ - Optional, defaults to ` '' `
67
+ - ** ` include-all-issue-labels ` **
68
+ - Only lock issues with all these labels, value must be
40
69
a comma separated list of labels or ` '' `
41
70
- Optional, defaults to ` '' `
42
- - ** ` issue-lock-labels ` **
71
+ - ** ` exclude-any-issue-labels ` **
72
+ - Do not lock issues with any of these labels, value must be
73
+ a comma separated list of labels or ` '' `
74
+ - Optional, defaults to ` '' `
75
+ - ** ` add-issue-labels ` **
43
76
- Labels to add before locking an issue, value must be
44
77
a comma separated list of labels or ` '' `
45
78
- Optional, defaults to ` '' `
46
- - ** ` issue-lock-comment ` **
79
+ - ** ` remove-issue-labels ` **
80
+ - Labels to remove before locking an issue, value must be
81
+ a comma separated list of labels or ` '' `
82
+ - Optional, defaults to ` '' `
83
+ - ** ` issue-comment ` **
47
84
- Comment to post before locking an issue
48
85
- Optional, defaults to ` '' `
49
86
- ** ` issue-lock-reason ` **
50
87
- Reason for locking an issue, value must be one
51
88
of ` resolved ` , ` off-topic ` , ` too heated ` , ` spam ` or ` '' `
52
89
- Optional, defaults to ` resolved `
53
- - ** ` pr-lock- inactive-days ` **
90
+ - ** ` pr-inactive-days ` **
54
91
- Number of days of inactivity before a closed pull request is locked
55
92
- Optional, defaults to ` 365 `
56
- - ** ` pr-exclude-created-before ` **
57
- - Do not lock pull requests created before a given timestamp,
93
+ - ** ` exclude-pr-created-before ` **
94
+ - Do not lock pull requests created before a given date,
95
+ value must follow ISO 8601, ignored
96
+ when ` exclude-pr-created-between ` is set
97
+ - Optional, defaults to ` '' `
98
+ - ** ` exclude-pr-created-after ` **
99
+ - Do not lock pull requests created after a given date,
100
+ value must follow ISO 8601, ignored
101
+ when ` exclude-pr-created-between ` is set
102
+ - Optional, defaults to ` '' `
103
+ - ** ` exclude-pr-created-between ` **
104
+ - Do not lock pull requests created in a given time interval,
105
+ value must follow ISO 8601
106
+ - Optional, defaults to ` '' `
107
+ - ** ` exclude-pr-closed-before ` **
108
+ - Do not lock pull requests closed before a given date,
109
+ value must follow ISO 8601, ignored
110
+ when ` exclude-pr-closed-between ` is set
111
+ - Optional, defaults to ` '' `
112
+ - ** ` exclude-pr-closed-after ` **
113
+ - Do not lock pull requests closed after a given date,
114
+ value must follow ISO 8601, ignored
115
+ when ` exclude-pr-closed-between ` is set
116
+ - Optional, defaults to ` '' `
117
+ - ** ` exclude-pr-closed-between ` **
118
+ - Do not lock pull requests closed in a given time interval,
58
119
value must follow ISO 8601
59
120
- Optional, defaults to ` '' `
60
- - ** ` pr-exclude-labels ` **
61
- - Do not lock pull requests with these labels, value must
62
- be a comma separated list of labels or ` '' `
121
+ - ** ` include-any-pr-labels ` **
122
+ - Only lock pull requests with any of these labels, value must be
123
+ a comma separated list of labels or ` '' ` , ignored
124
+ when ` include-all-pr-labels ` is set
125
+ - Optional, defaults to ` '' `
126
+ - ** ` include-all-pr-labels ` **
127
+ - Only lock pull requests with all these labels, value must be
128
+ a comma separated list of labels or ` '' `
129
+ - Optional, defaults to ` '' `
130
+ - ** ` exclude-any-pr-labels ` **
131
+ - Do not lock pull requests with any of these labels, value must be
132
+ a comma separated list of labels or ` '' `
63
133
- Optional, defaults to ` '' `
64
- - ** ` pr-lock -labels` **
134
+ - ** ` add-pr -labels` **
65
135
- Labels to add before locking a pull request, value must be
66
136
a comma separated list of labels or ` '' `
67
137
- Optional, defaults to ` '' `
68
- - ** ` pr-lock-comment ` **
138
+ - ** ` remove-pr-labels ` **
139
+ - Labels to remove before locking a pull request, value must be
140
+ a comma separated list of labels or ` '' `
141
+ - Optional, defaults to ` '' `
142
+ - ** ` pr-comment ` **
69
143
- Comment to post before locking a pull request
70
144
- Optional, defaults to ` '' `
71
145
- ** ` pr-lock-reason ` **
@@ -76,6 +150,9 @@ The action can be configured using [input parameters](https://docs.github.com/en
76
150
- Limit locking to only issues or pull requests, value must be
77
151
one of ` issues ` , ` prs ` or ` '' `
78
152
- Optional, defaults to ` '' `
153
+ - ** ` log-output ` **
154
+ - Log output parameters, value must be either ` true ` or ` false `
155
+ - Optional, defaults to ` false `
79
156
80
157
### Outputs
81
158
@@ -92,7 +169,8 @@ The action can be configured using [input parameters](https://docs.github.com/en
92
169
## Examples
93
170
94
171
The following workflow will search once an hour for closed issues
95
- and pull requests that can be locked.
172
+ and pull requests that have not had any activity
173
+ in the past year and can be locked.
96
174
97
175
<!-- prettier-ignore -->
98
176
``` yaml
@@ -114,7 +192,7 @@ jobs:
114
192
action :
115
193
runs-on : ubuntu-latest
116
194
steps :
117
- - uses : dessant/lock-threads@v2
195
+ - uses : dessant/lock-threads@v3
118
196
` ` `
119
197
120
198
Edit the workflow after the initial backlog of issues and pull requests
@@ -153,36 +231,53 @@ jobs:
153
231
action :
154
232
runs-on : ubuntu-latest
155
233
steps :
156
- - uses : dessant/lock-threads@v2
234
+ - uses : dessant/lock-threads@v3
157
235
with :
158
236
github-token : ${{ github.token }}
159
- issue-lock-inactive-days : ' 365'
160
- issue-exclude-created-before : ' '
161
- issue-exclude-labels : ' '
162
- issue-lock-labels : ' '
163
- issue-lock-comment : ' '
237
+ issue-inactive-days : ' 365'
238
+ exclude-issue-created-before : ' '
239
+ exclude-issue-created-after : ' '
240
+ exclude-issue-created-between : ' '
241
+ exclude-issue-closed-before : ' '
242
+ exclude-issue-closed-after : ' '
243
+ exclude-issue-closed-between : ' '
244
+ include-any-issue-labels : ' '
245
+ include-all-issue-labels : ' '
246
+ exclude-any-issue-labels : ' '
247
+ add-issue-labels : ' '
248
+ remove-issue-labels : ' '
249
+ issue-comment : ' '
164
250
issue-lock-reason : ' resolved'
165
- pr-lock-inactive-days : ' 365'
166
- pr-exclude-created-before : ' '
167
- pr-exclude-labels : ' '
168
- pr-lock-labels : ' '
169
- pr-lock-comment : ' '
251
+ pr-inactive-days : ' 365'
252
+ exclude-pr-created-before : ' '
253
+ exclude-pr-created-after : ' '
254
+ exclude-pr-created-between : ' '
255
+ exclude-pr-closed-before : ' '
256
+ exclude-pr-closed-after : ' '
257
+ exclude-pr-closed-between : ' '
258
+ include-any-pr-labels : ' '
259
+ include-all-pr-labels : ' '
260
+ exclude-any-pr-labels : ' '
261
+ add-pr-labels : ' '
262
+ remove-pr-labels : ' '
263
+ pr-comment : ' '
170
264
pr-lock-reason : ' resolved'
171
265
process-only : ' '
266
+ log-output : false
172
267
` ` `
173
268
174
- ### Excluding issues and pull requests
269
+ ### Filtering issues and pull requests
175
270
176
271
This step will lock only issues, and exclude issues created before 2018,
177
272
or those with the ` upstream` or `help-wanted` labels applied.
178
273
179
274
<!-- prettier-ignore -->
180
275
` ` ` yaml
181
276
steps:
182
- - uses: dessant/lock-threads@v2
277
+ - uses: dessant/lock-threads@v3
183
278
with:
184
- issue- exclude-created-before: '2018-01-01T00:00:00Z'
185
- issue- exclude-labels: 'upstream, help-wanted'
279
+ exclude-issue -created-before: '2018-01-01T00:00:00Z'
280
+ exclude-any-issue -labels: 'upstream, help-wanted'
186
281
process-only: 'issues'
187
282
` ` `
188
283
@@ -192,12 +287,51 @@ with the `wip` label applied.
192
287
<!-- prettier-ignore -->
193
288
` ` ` yaml
194
289
steps:
195
- - uses: dessant/lock-threads@v2
290
+ - uses: dessant/lock-threads@v3
196
291
with:
197
- pr- exclude-labels: 'wip'
292
+ exclude-any-pr -labels: 'wip'
198
293
process-only: 'prs'
199
294
` ` `
200
295
296
+ This step will lock only issues, and exclude issues closed before 2018,
297
+ or those created in 2018 and 2019.
298
+
299
+ <!-- prettier-ignore -->
300
+ ` ` ` yaml
301
+ steps:
302
+ - uses: dessant/lock-threads@v3
303
+ with:
304
+ exclude-issue-created-between: '2018-01-01T00:00:00Z/2019-12-31T23:59:59.999Z'
305
+ exclude-issue-closed-before: '2018-01-01T00:00:00Z'
306
+ process-only: 'issues'
307
+ ` ` `
308
+
309
+ This step will lock issues that have the `incomplete` _or_ `invalid`
310
+ labels applied, and pull requests that have the `qa : done` _and_ `published`
311
+ labels applied.
312
+
313
+ <!-- prettier-ignore -->
314
+ ` ` ` yaml
315
+ steps:
316
+ - uses: dessant/lock-threads@v3
317
+ with:
318
+ include-any-issue-labels: 'incomplete, invalid'
319
+ include-all-pr-labels: 'qa: done, published'
320
+
321
+ ` ` `
322
+
323
+ This step will lock issues that have not had any activity in the past 180 days.
324
+
325
+ <!-- prettier-ignore -->
326
+ ` ` ` yaml
327
+ steps:
328
+ - uses: dessant/lock-threads@v3
329
+ with:
330
+ issue-inactive-days: '180'
331
+ process-only: 'issues'
332
+
333
+ ` ` `
334
+
201
335
# ## Commenting and labeling
202
336
203
337
This step will post a comment on issues and pull requests before locking them,
@@ -206,19 +340,32 @@ and apply the `outdated` label to issues.
206
340
<!-- prettier-ignore -->
207
341
` ` ` yaml
208
342
steps:
209
- - uses: dessant/lock-threads@v2
343
+ - uses: dessant/lock-threads@v3
210
344
with:
211
- issue-lock -labels: 'outdated'
212
- issue-lock- comment: >
345
+ add-issue -labels: 'outdated'
346
+ issue-comment: >
213
347
This issue has been automatically locked since there
214
348
has not been any recent activity after it was closed.
215
349
Please open a new issue for related bugs.
216
- pr-lock- comment: >
350
+ pr-comment: >
217
351
This pull request has been automatically locked since there
218
352
has not been any recent activity after it was closed.
219
353
Please open a new issue for related bugs.
220
354
` ` `
221
355
356
+ This step will apply the `qa : done` and `archived` labels,
357
+ and remove the `qa : primary` and `needs: user feedback` labels
358
+ before locking issues.
359
+
360
+ <!-- prettier-ignore -->
361
+ ` ` ` yaml
362
+ steps:
363
+ - uses: dessant/lock-threads@v3
364
+ with:
365
+ add-issue-labels: 'qa: done, archived'
366
+ remove-issue-labels: 'qa: primary, needs: user feedback'
367
+ ` ` `
368
+
222
369
# ## Using a personal access token
223
370
224
371
The action uses an installation access token by default to interact with GitHub.
@@ -234,7 +381,7 @@ using the `github-token` input parameter.
234
381
<!-- prettier-ignore -->
235
382
` ` ` yaml
236
383
steps:
237
- - uses: dessant/lock-threads@v2
384
+ - uses: dessant/lock-threads@v3
238
385
with:
239
386
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
240
387
` ` `
@@ -248,9 +395,9 @@ applying or removing milestones, or pushing commits.
248
395
249
396
An easy way to check and see which issues or pull requests will initially
250
397
be locked is to add the `updated` search qualifier to either the issue
251
- or pull request page filter for your repository :
398
+ or pull request search field for your repository :
252
399
` is:closed is:unlocked updated:<2018-12-20` .
253
- Adjust the date to be 365 days ago (or whatever you set for `*-lock- inactive-days`)
400
+ Adjust the date to be 365 days ago (or whatever you set for `*-inactive-days`)
254
401
to see which issues or pull requests will be locked.
255
402
256
403
# # Why are only some issues and pull requests processed?
0 commit comments