@@ -16,7 +16,7 @@ please consider contributing with
1616
1717## Usage
1818
19- Create a ` lock.yml ` workflow file in the ` .github/workflows ` directory,
19+ Create the ` lock.yml ` workflow file in the ` .github/workflows ` directory,
2020use one of the [ example workflows] ( #examples ) to get started.
2121
2222### Inputs
@@ -28,44 +28,118 @@ The action can be configured using [input parameters](https://docs.github.com/en
2828 - GitHub access token, value must be ` ${{ github.token }} ` or an encrypted
2929 secret that contains a [ personal access token] ( #using-a-personal-access-token )
3030 - Optional, defaults to ` ${{ github.token }} `
31- - ** ` issue-lock- inactive-days ` **
31+ - ** ` issue-inactive-days ` **
3232 - Number of days of inactivity before a closed issue is locked
3333 - 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,
3646 value must follow ISO 8601
3747 - 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
4069 a comma separated list of labels or ` '' `
4170 - 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 ` **
4376 - Labels to add before locking an issue, value must be
4477 a comma separated list of labels or ` '' `
4578 - 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 ` **
4784 - Comment to post before locking an issue
4885 - Optional, defaults to ` '' `
4986- ** ` issue-lock-reason ` **
5087 - Reason for locking an issue, value must be one
5188 of ` resolved ` , ` off-topic ` , ` too heated ` , ` spam ` or ` '' `
5289 - Optional, defaults to ` resolved `
53- - ** ` pr-lock- inactive-days ` **
90+ - ** ` pr-inactive-days ` **
5491 - Number of days of inactivity before a closed pull request is locked
5592 - 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,
58119 value must follow ISO 8601
59120 - 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 ` '' `
63133 - Optional, defaults to ` '' `
64- - ** ` pr-lock -labels` **
134+ - ** ` add-pr -labels` **
65135 - Labels to add before locking a pull request, value must be
66136 a comma separated list of labels or ` '' `
67137 - 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 ` **
69143 - Comment to post before locking a pull request
70144 - Optional, defaults to ` '' `
71145- ** ` pr-lock-reason ` **
@@ -76,6 +150,9 @@ The action can be configured using [input parameters](https://docs.github.com/en
76150 - Limit locking to only issues or pull requests, value must be
77151 one of ` issues ` , ` prs ` or ` '' `
78152 - Optional, defaults to ` '' `
153+ - ** ` log-output ` **
154+ - Log output parameters, value must be either ` true ` or ` false `
155+ - Optional, defaults to ` false `
79156
80157### Outputs
81158
@@ -92,7 +169,8 @@ The action can be configured using [input parameters](https://docs.github.com/en
92169## Examples
93170
94171The 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.
96174
97175<!-- prettier-ignore -->
98176``` yaml
@@ -114,7 +192,7 @@ jobs:
114192 action :
115193 runs-on : ubuntu-latest
116194 steps :
117- - uses : dessant/lock-threads@v2
195+ - uses : dessant/lock-threads@v3
118196` ` `
119197
120198Edit the workflow after the initial backlog of issues and pull requests
@@ -153,36 +231,53 @@ jobs:
153231 action :
154232 runs-on : ubuntu-latest
155233 steps :
156- - uses : dessant/lock-threads@v2
234+ - uses : dessant/lock-threads@v3
157235 with :
158236 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 : ' '
164250 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 : ' '
170264 pr-lock-reason : ' resolved'
171265 process-only : ' '
266+ log-output : false
172267` ` `
173268
174- ### Excluding issues and pull requests
269+ ### Filtering issues and pull requests
175270
176271This step will lock only issues, and exclude issues created before 2018,
177272or those with the ` upstream` or `help-wanted` labels applied.
178273
179274<!-- prettier-ignore -->
180275` ` ` yaml
181276 steps:
182- - uses: dessant/lock-threads@v2
277+ - uses: dessant/lock-threads@v3
183278 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'
186281 process-only: 'issues'
187282` ` `
188283
@@ -192,12 +287,51 @@ with the `wip` label applied.
192287<!-- prettier-ignore -->
193288` ` ` yaml
194289 steps:
195- - uses: dessant/lock-threads@v2
290+ - uses: dessant/lock-threads@v3
196291 with:
197- pr- exclude-labels: 'wip'
292+ exclude-any-pr -labels: 'wip'
198293 process-only: 'prs'
199294` ` `
200295
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+
201335# ## Commenting and labeling
202336
203337This step will post a comment on issues and pull requests before locking them,
@@ -206,19 +340,32 @@ and apply the `outdated` label to issues.
206340<!-- prettier-ignore -->
207341` ` ` yaml
208342 steps:
209- - uses: dessant/lock-threads@v2
343+ - uses: dessant/lock-threads@v3
210344 with:
211- issue-lock -labels: 'outdated'
212- issue-lock- comment: >
345+ add-issue -labels: 'outdated'
346+ issue-comment: >
213347 This issue has been automatically locked since there
214348 has not been any recent activity after it was closed.
215349 Please open a new issue for related bugs.
216- pr-lock- comment: >
350+ pr-comment: >
217351 This pull request has been automatically locked since there
218352 has not been any recent activity after it was closed.
219353 Please open a new issue for related bugs.
220354` ` `
221355
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+
222369# ## Using a personal access token
223370
224371The action uses an installation access token by default to interact with GitHub.
@@ -234,7 +381,7 @@ using the `github-token` input parameter.
234381<!-- prettier-ignore -->
235382` ` ` yaml
236383 steps:
237- - uses: dessant/lock-threads@v2
384+ - uses: dessant/lock-threads@v3
238385 with:
239386 github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
240387` ` `
@@ -248,9 +395,9 @@ applying or removing milestones, or pushing commits.
248395
249396An easy way to check and see which issues or pull requests will initially
250397be 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 :
252399` 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`)
254401to see which issues or pull requests will be locked.
255402
256403# # Why are only some issues and pull requests processed?
0 commit comments