Skip to content

Commit

Permalink
feat: added more options and defaults to lock-closed
Browse files Browse the repository at this point in the history
BREAKING-CHANGE: Changed default of issue-inactive-days from 365 to 30
  • Loading branch information
prisis committed May 21, 2024
1 parent c1f5847 commit 2ffc985
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,7 @@
- name: "breaking change"
description: "Cannot be merged when next version is not a major release"
color: "B05D08"

- name: "bot: closed"
description: ""
color: "fef2c0"
38 changes: 37 additions & 1 deletion workflow/lock-closed.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,43 @@ Specify the target repository this action should run on. This is used to prevent

The number of days before an issue is considered inactive.

- This `input` is optional with a default of 365
- This `input` is optional with a default of 30

#### issue-comment

Comment to post before locking an issue.

- This `input` is optional with a default of
> This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
>
> Please note this issue tracker is not a help forum. We recommend using our GitHub Discussions tab for questions.
#### pr-inactive-days

Number of days of inactivity before a closed pull request is locked.

- This `input` is optional with a default of 30

#### pr-comment

Comment to post before locking a pull request.

- This `input` is optional with a default of
> This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
>
> Please note this issue tracker is not a help forum. We recommend using our GitHub Discussions tab for questions.
#### exclude-any-issue-labels

Do not lock issues with any of these labels, value must be a comma separated list of labels or ''

- This `input` is optional with a default of `p: 2-high,p: 3-urgent,do NOT merge yet,good first issue`

#### add-issue-labels

Labels to add before locking an issue, value must be a comma separated list of labels or ''

- This `input` is optional with a default of `bot: closed`

## Usage

Expand Down
38 changes: 37 additions & 1 deletion workflow/lock-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,40 @@ on: # yamllint disable-line rule:truthy
type: "string"
issue-inactive-days:
description: "The number of days before an issue is considered inactive."
default: "365"
default: "30"
required: false
type: "string"
issue-comment:
description: "Comment to post before locking an issue"
default: >
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using our GitHub Discussions tab for questions.
required: false
type: "string"
pr-inactive-days:
description: "Number of days of inactivity before a closed pull request is locked"
default: "30"
required: false
type: "string"
pr-comment:
description: "Comment to post before locking a pull request"
default: >
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using our GitHub Discussions tab for questions.
required: false
type: "string"
exclude-any-issue-labels:
description: "Do not lock issues with any of these labels, value must be a comma separated list of labels or ''"
default: "p: 2-high,p: 3-urgent,do NOT merge yet,good first issue"
required: false
type: "string"
add-issue-labels:
description: "Labels to add before locking an issue, value must be a comma separated list of labels or ''"
default: "bot: closed"
required: false
type: string

permissions:
issues: "write"
Expand All @@ -35,4 +66,9 @@ jobs:

- uses: "dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771" # v5.0.1
with:
exclude-any-issue-labels: "${{ inputs.exclude-any-issue-labels }}"
add-issue-labels: "${{ inputs.add-issue-labels }}"
issue-inactive-days: "${{ inputs.issue-inactive-days }}"
issue-comment: "${{ inputs.issue-comment }}"
pr-inactive-days: "${{ inputs.pr-inactive-days }}"
pr-comment: "${{ inputs.pr-comment }}"

0 comments on commit 2ffc985

Please sign in to comment.