Skip to content

Commit

Permalink
feat(close-reason): add new inputs issue-close-reason and `pull-req…
Browse files Browse the repository at this point in the history
…uest-close-reason`

Those inputs allow you to specify the reason for closing an item.
Closes #779
BREAKING CHANGE:
The close reason will now be by default 'NOT_PLANNED' instead of 'COMPLETED' since it makes more sense.
If you want to change the new default behavior, you can use these inputs:
issue-close-reason: 'completed'
pull-request-close-reason: 'completed'
  • Loading branch information
C0ZEN committed Aug 23, 2022
1 parent 4642b60 commit d813b45
Show file tree
Hide file tree
Showing 54 changed files with 1,559 additions and 436 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ To help us have a clear vision over the workflow and also for you if you are jus
- If the issue has a stale label, check if it was updated after the addition of the stale label
- If it was updated, remove the stale state (stale label) and stop the processing
- Else, check if issue last update is older than X days (coming from `issue-days-before-close`)
- If it is old, close the issue
- If it is old, close the issue (using the close reason coming from `issue-close-reason`)
- Check if the action should also add a comment (coming from the `issue-close-comment` input)
- When the input value is not empty, add a comment
- Check if the action should also add extra labels (coming from the `issue-add-labels-after-close` input)
Expand Down Expand Up @@ -193,7 +193,7 @@ To help us have a clear vision over the workflow and also for you if you are jus
- If the pull request has a stale label, check if it was updated after the addition of the stale label
- If it was updated, remove the stale state (stale label) and stop the processing
- Else, check if pull request last update is older than X days (coming from `pull-request-days-before-close`)
- If it is old, close the pull request
- If it is old, close the pull request (using the close reason coming from `pull-request-close-reason`)
- Check if the action should also add a comment (coming from the `pull-request-close-comment` input)
- When the input value is not empty, add a comment
- Check if the action should also add extra labels (coming from the `pull-request-add-labels-after-close` input)
Expand Down
146 changes: 74 additions & 72 deletions README.md

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ inputs:
description: 'Allow to process the issues.'
required: false
default: 'true'
issue-close-reason:
description: 'The reason when closing an issue (completed or not planned).'
required: false
default: 'not planned'
# Pull request inputs
## Labels
pull-request-stale-label:
Expand Down Expand Up @@ -237,6 +241,10 @@ inputs:
description: 'Allow to process the pull requests.'
required: false
default: 'true'
pull-request-close-reason:
description: 'The reason when closing a pull request (completed or not planned).'
required: false
default: 'not planned'
pull-request-to-draft-instead-of-stale:
description: 'Convert the pull request to a draft pull request instead of handling it as a stale candidate.'
required: false
Expand Down
4 changes: 2 additions & 2 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion documentation/docs/01-introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: |
Introduction and presentation of what is the Sonia-corporation stale action.
What is the mindset behind this action.
What are the main features.
How and why it was crated.
How and why it was created.
tags:
- Introduction
---
Expand Down
10 changes: 6 additions & 4 deletions documentation/docs/03-all-inputs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,16 @@ The list of all the inputs.
| [pull-request-add-labels-after-close](pull-requests/inputs/pull-request-add-labels-after-close-input) | A list of labels added when the processing close the pull request (multiline). | |
| [pull-request-delete-branch-after-close](pull-requests/inputs/pull-request-delete-branch-after-close-input) | Delete the branch when the processing close the pull request. | `false` |
| **Limiters** | | |
| [issue-limit-api-queries-count](issues/inputs/issue-limit-api-queries-count-input) | Limit the quantity of API queries calls performed during the processing of issues (-1 for unlimited). | `-1` |
| [issue-limit-api-mutations-count](issues/inputs/issue-limit-api-mutations-count-input) | Limit the quantity of API mutations calls performed during the processing of issues (-1 for unlimited). | `-1` |
| [issue-limit-api-queries-count](issues/inputs/issue-limit-api-queries-count-input) | Limit the quantity of API queries calls performed during the processing of issues (`-1` for unlimited). | `-1` |
| [issue-limit-api-mutations-count](issues/inputs/issue-limit-api-mutations-count-input) | Limit the quantity of API mutations calls performed during the processing of issues (`-1` for unlimited). | `-1` |
| [issue-ignore-before-creation-date](issues/inputs/issue-ignore-before-creation-date-input) | Allow to ignore the processing of issues that were created before this date ([ISO 8601](https://moment.github.io/luxon/#/parsing?id=iso-8601)). | |
| [pull-request-limit-api-queries-count](pull-requests/inputs/pull-request-limit-api-queries-count-input) | Limit the quantity of API queries calls performed during the processing of pull requests (-1 for unlimited). | `-1` |
| [pull-request-limit-api-mutations-count](pull-requests/inputs/pull-request-limit-api-mutations-count-input) | Limit the quantity of API mutations calls performed during the processing of pull requests (-1 for unlimited). | `-1` |
| [pull-request-limit-api-queries-count](pull-requests/inputs/pull-request-limit-api-queries-count-input) | Limit the quantity of API queries calls performed during the processing of pull requests (`-1` for unlimited). | `-1` |
| [pull-request-limit-api-mutations-count](pull-requests/inputs/pull-request-limit-api-mutations-count-input) | Limit the quantity of API mutations calls performed during the processing of pull requests (`-1` for unlimited). | `-1` |
| [pull-request-ignore-before-creation-date](pull-requests/inputs/pull-request-ignore-before-creation-date-input) | Allow to ignore the processing of pull requests that were created before this date ([ISO 8601](https://moment.github.io/luxon/#/parsing?id=iso-8601)). | |
| [pull-request-ignore-draft](pull-requests/inputs/pull-request-ignore-draft-input) | Allow to ignore the processing of pull requests that are drafts. | `false` |
| **Others** | | |
| [issue-processing](issues/inputs/issue-processing-input) | Allow to process the issues. | `true` |
| [issue-close-reason](issues/inputs/issue-close-reason-input) | The reason when closing an issue (`completed` or `not planned`). | `not planned` |
| [pull-request-processing](pull-requests/inputs/pull-request-processing-input) | Allow to process the pull requests. | `true` |
| [pull-request-close-reason](pull-requests/inputs/pull-request-close-reason-input) | The reason when closing a pull request (`completed` or `not planned`). | `not planned` |
| [pull-request-to-draft-instead-of-stale](pull-requests/inputs/pull-request-to-draft-instead-of-stale-input) | Convert the pull request to a draft pull request instead of handling it as a stale candidate. | `false` |

0 comments on commit d813b45

Please sign in to comment.