Skip to content

Commit

Permalink
Merge pull request #894 from Sonia-corporation/feature/merge-develop-…
Browse files Browse the repository at this point in the history
…into-master
  • Loading branch information
C0ZEN authored Aug 31, 2022
2 parents c862ad1 + 9c52b45 commit 67c62b9
Show file tree
Hide file tree
Showing 27 changed files with 255 additions and 647 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,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 (using the close reason coming from `pull-request-close-reason`)
- If it is old, close the pull request
- 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
77 changes: 38 additions & 39 deletions README.md

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,6 @@ 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-add-labels-after-stale:
description: 'A list of labels added when the processing stale the pull request (multiline).'
required: false
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion documentation/docs/03-all-inputs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ The list of all the inputs.
| [issue-remove-labels-after-stale](issues/inputs/issue-remove-labels-after-stale-input) | A list of labels removed when the processing stale the issue (multiline). | |
| [issue-add-labels-after-close](issues/inputs/issue-add-labels-after-close-input) | A list of labels added when the processing close the issue (multiline). | |
| [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-add-labels-after-stale](pull-requests/inputs/pull-request-add-labels-after-stale-input) | A list of labels added when the processing stale the pull request (multiline). | |
| [pull-request-remove-labels-after-stale](pull-requests/inputs/pull-request-remove-labels-after-stale-input) | A list of labels removed when the processing stale the pull request (multiline). | |
| [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). | |
Expand Down
79 changes: 39 additions & 40 deletions documentation/docs/08-pull-requests/01-inputs/01-all-inputs.mdx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ This can be useful if you wish to improve the communication and the process on h

:::note

You can also specify the reason for closing this pull request by using the [close reason input](pull-request-close-reason-input),
add labels onto it by using the [add labels after close input](pull-request-add-labels-after-close-input)
You can also add labels onto it by using the [add labels after close input](pull-request-add-labels-after-close-input)
and define the number of days before closing it by using the [days before close input](pull-request-days-before-close-input).

:::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ The pull request will be closed tomorrow if no update occur until then.

:::info

You can also specify the reason for closing this pull request by using the [close reason input](pull-request-close-reason-input),
add labels onto it by using the [add labels after close input](pull-request-add-labels-after-close-input)
You can also add labels onto it by using the [add labels after close input](pull-request-add-labels-after-close-input)
and add a comment to explain why it was closed by using the [close comment input](pull-request-close-comment-input).

:::
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ If not, the GitHub API will throw an error.

:::info

You can also specify the reason for closing this pull request by using the [close reason input](pull-request-close-reason-input),
add a comment to explain why it was closed by using the [close comment input](pull-request-close-comment-input)
You can also add a comment to explain why it was closed by using the [close comment input](pull-request-close-comment-input)
and define the number of days before closing it by using the [days before close input](pull-request-days-before-close-input).

:::
Expand Down
12 changes: 5 additions & 7 deletions documentation/docs/16-migrations/02-migration-to-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@ From [v1](https://github.com/Sonia-corporation/stale/releases/tag/1.61.0) to [v2

### Close reason 🍬 {#close-reason}

These two new inputs were introduced:
One new input was introduced:

- [issue-close-reason](../issues/inputs/issue-close-reason-input)
- [pull-request-close-reason](../pull-requests/inputs/pull-request-close-reason-input)

They will allow you to define what is the reason when an issue or a pull request is closed.
It will allow you to define what is the reason when an issue is closed.
This new feature is possible following the [May 19, 2022, update](https://github.blog/changelog/2022-05-19-the-new-github-issues-may-19th-update/#%F0%9F%95%B5%F0%9F%8F%BD%E2%99%80%EF%B8%8F-issue-closed-reasons) for the GitHub issues.

**Before:**

Every issue and pull request were closed with the default value in GitHub, which is `COMPLETED`.
Every issue were closed with the default value in GitHub, which is `COMPLETED`.

**After:**

Every issue and pull request will now be closed with `NOT_PLANNED` as the default value.
Every issue will now be closed with `NOT_PLANNED` as the default value.
To change the behavior back to the previous one, you can configure your action as follows:

```yml {6-7}
Expand All @@ -40,12 +39,11 @@ id: stale
uses: sonia-corporation/stale@latest
with:
issue-close-reason: 'not planned'
pull-request-close-reason: 'not planned'
```
:::info
We decided to actually change the default value, because it makes more sense for most users to consider a close issue or pull request as not planned.
We decided to actually change the default value, because it makes more sense for most users to consider a closed issue as not planned.
Like suggested by GitHub, they consider this value as a stale reason, which is actually why you are here. 😉
:::
49 changes: 15 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"cross-env": "7.0.3",
"cz-customizable": "6.9.2",
"cz-customizable-ghooks": "2.0.0",
"eslint": "8.23.0",
"eslint": "8.22.0",
"eslint-config-google": "0.14.0",
"eslint-config-prettier": "8.5.0",
"eslint-config-recommended": "4.1.0",
Expand Down
1 change: 0 additions & 1 deletion src/core/inputs/inputs.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export enum EInputs {
PULL_REQUEST_ADD_LABELS_AFTER_STALE = `pull-request-add-labels-after-stale`,
PULL_REQUEST_REMOVE_LABELS_AFTER_STALE = `pull-request-remove-labels-after-stale`,
PULL_REQUEST_CLOSE_COMMENT = `pull-request-close-comment`,
PULL_REQUEST_CLOSE_REASON = `pull-request-close-reason`,
PULL_REQUEST_DAYS_BEFORE_CLOSE = `pull-request-days-before-close`,
PULL_REQUEST_DAYS_BEFORE_STALE = `pull-request-days-before-stale`,
PULL_REQUEST_DELETE_BRANCH_AFTER_CLOSE = `pull-request-delete-branch-after-close`,
Expand Down
2 changes: 0 additions & 2 deletions src/core/inputs/interfaces/pull-requests-inputs.interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ECloseReason } from '@core/inputs/enums/close-reason.enum';
import { IInputs } from '@core/inputs/types/inputs';
import { IIso8601Date } from '@utils/dates/iso-8601';
import { IComment } from '@utils/types/comment';
Expand All @@ -7,7 +6,6 @@ export interface IPullRequestsInputs extends IInputs {
readonly pullRequestAddLabelsAfterClose: string[];
readonly pullRequestAddLabelsAfterStale: string[];
readonly pullRequestCloseComment: IComment | '';
readonly pullRequestCloseReason: ECloseReason;
readonly pullRequestDaysBeforeClose: number;
readonly pullRequestDaysBeforeStale: number;
readonly pullRequestDeleteBranchAfterClose: boolean;
Expand Down
Loading

1 comment on commit 67c62b9

@vercel
Copy link

@vercel vercel bot commented on 67c62b9 Aug 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.