Skip to content

Commit

Permalink
fix(options)!: Make not_planned the default close-issue-reason (#807
Browse files Browse the repository at this point in the history
)

* docs: add source for default testing options

* fix(options)!: Default to 'Close as not planned'

GitHub introduced an additional close reason 'Close as not planned':
https://github.blog/changelog/2022-05-19-the-new-github-issues-may-19th-update/

'stale' is a use case for this close reason

Fixes #789

BREAKING CHANGE:
`close-issue-reason` defaults to `not_planned` (previously: ``
which defaulted to `completed`)
This closes the issue as 'not planned' on GitHub rather than 'completed'

See: https://github.blog/changelog/2022-05-19-the-new-github-issues-may-19th-update
  • Loading branch information
david-allison authored Sep 20, 2022
1 parent 99b6c70 commit 02e44c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Every argument is optional.
| [close-pr-message](#close-pr-message) | Comment on the staled PRs while closed | |
| [stale-issue-label](#stale-issue-label) | Label to apply on staled issues | `Stale` |
| [close-issue-label](#close-issue-label) | Label to apply on closed issues | |
| [close-issue-reason](#close-issue-reason) | Reason to use when closing issues | |
| [close-issue-reason](#close-issue-reason) | Reason to use when closing issues | `not_planned` |
| [stale-pr-label](#stale-pr-label) | Label to apply on staled PRs | `Stale` |
| [close-pr-label](#close-pr-label) | Label to apply on closed PRs | |
| [exempt-issue-labels](#exempt-issue-labels) | Labels on issues exempted from stale | |
Expand Down Expand Up @@ -226,7 +226,7 @@ Required Permission: `issues: write`

Specify the [reason](https://github.blog/changelog/2022-05-19-the-new-github-issues-may-19th-update/) used when closing issues. Valid values are `completed` and `not_planned`.

Default value: unset
Default value: `not_planned`

#### stale-pr-label

Expand Down
4 changes: 3 additions & 1 deletion __tests__/constants/default-processor-options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {IIssuesProcessorOptions} from '../../src/interfaces/issues-processor-options';

// Default options for use in tests.
// Mirrors the defaults defined in action.yml
export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({
repoToken: 'none',
staleIssueMessage: 'This issue is stale',
Expand Down Expand Up @@ -51,6 +53,6 @@ export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({
ignoreIssueUpdates: undefined,
ignorePrUpdates: undefined,
exemptDraftPr: false,
closeIssueReason: '',
closeIssueReason: 'not_planned',
includeOnlyAssigned: false
});
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ inputs:
required: false
close-issue-reason:
description: 'The reason to use when closing an issue.'
default: ''
default: 'not_planned'
required: false
stale-pr-label:
description: 'The label to apply when a pull request is stale.'
Expand Down

0 comments on commit 02e44c8

Please sign in to comment.