Skip to content

Commit

Permalink
feat(milestone): add new input pull-request-only-any-milestones
Browse files Browse the repository at this point in the history
This new input will let you process only the pull requests that contains one of the specified milestone.
Closes #518
  • Loading branch information
C0ZEN committed Feb 20, 2022
1 parent 41f4f0d commit 7a1197e
Show file tree
Hide file tree
Showing 21 changed files with 562 additions and 64 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ To help us have a clear vision over the workflow and also for you if you are jus
- Check if the pull request creation date is before x date and stop the processing if this is the case (coming from the `pull-request-ignore-before-creation-date` input)
- Check if the pull request is a draft and stop the processing if this is the case (coming from the `pull-request-ignore-draft` input)
- Check if the input `pull-request-only-any-project-cards` contains some project cards. If this is the case and the pull request has at least one project card matching linked to it, the processing will continue, else the processing will stop.
- Check if the input `pull-request-only-any-milestones` contains some milestones. If this is the case and the pull request has at least one milestone matching linked to it, the processing will continue, else the processing will stop.
- Check if the pull request has already a stale state (stale label)
- 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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ All the inputs that are used both for issues and pull requests.
| [pull-request-limit-api-queries-count](https://sonia-corporation.github.io/stale/docs/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](https://sonia-corporation.github.io/stale/docs/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-only-any-project-cards](https://sonia-corporation.github.io/stale/docs/pull-requests/inputs/pull-request-only-any-project-cards-input) | Only allow the processing of pull requests that contains one of those project cards (multiline). | |
| [pull-request-only-any-milestones](https://sonia-corporation.github.io/stale/docs/pull-requests/inputs/pull-request-only-any-milestones-input) | Only allow the processing of pull requests that contains one of those milestones (multiline). | |

## All the pull requests outputs

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ inputs:
description: 'Only allow the processing of pull requests that contains one of those project cards (multiline).'
required: false
default: ''
pull-request-only-any-milestones:
description: 'Only allow the processing of pull requests that contains one of those milestones (multiline).'
required: false
default: ''
outputs:
# Issues outputs
processed-issues-count:
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions documentation/docs/03-all-inputs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ The list of all the inputs.
| [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-only-any-project-cards](pull-requests/inputs/pull-request-only-any-project-cards-input) | Only allow the processing of pull requests that contains one of those project cards (multiline). | |
| [pull-request-only-any-milestones](pull-requests/inputs/pull-request-only-any-milestones-input) | Only allow the processing of pull requests that contains one of those milestones (multiline). | |
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ The list of all the pull requests inputs.
| [pull-request-limit-api-queries-count](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-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-only-any-project-cards](pull-request-only-any-project-cards-input) | Only allow the processing of pull requests that contains one of those project cards (multiline). | |
| [pull-request-only-any-milestones](pull-request-only-any-milestones-input) | Only allow the processing of pull requests that contains one of those milestones (multiline). | |
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
id: pull-request-only-any-project-cards-input
title: Pull request only any project cards input
description: |
All the information you need to know about the pull request only any project cards input.
Including a detailed description and an example.
All the information you need to know about the pull request only any project cards input.
Including a detailed description and an example.
tags:
- Pull requests
- Inputs
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
id: pull-request-only-any-milestones-input
title: Pull request only any milestones input
description: |
All the information you need to know about the pull request only any milestones input.
Including a detailed description and an example.
tags:
- Pull requests
- Inputs
- Milestones
---

### Input {#input}

Name: `pull-request-only-any-milestones`
Type: `string[]`
Default value: `[]`

### Description {#description}

This input will let you process only the pull requests that are linked to a milestone which is white-listed with this input.
This can be useful when you use the milestones for triage.

### Example {#example}

```yml {6-8}
# ...
name: Stale
id: stale
uses: sonia-corporation/stale@latest
with:
pull-request-only-any-milestones: |
milestone-x
milestone-y
```
1 change: 1 addition & 0 deletions src/core/inputs/inputs.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ export enum EInputs {
PULL_REQUEST_LIMIT_API_MUTATIONS_COUNT = `pull-request-limit-api-mutations-count`,
PULL_REQUEST_LIMIT_API_QUERIES_COUNT = `pull-request-limit-api-queries-count`,
PULL_REQUEST_ONLY_ANY_PROJECT_CARDS = `pull-request-only-any-project-cards`,
PULL_REQUEST_ONLY_ANY_MILESTONES = `pull-request-only-any-milestones`,
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface IPullRequestsInputs extends IInputs {
readonly pullRequestIgnoreDraft: boolean;
readonly pullRequestLimitApiMutationsCount: number;
readonly pullRequestLimitApiQueriesCount: number;
readonly pullRequestOnlyAnyMilestones: string[];
readonly pullRequestOnlyAnyProjectCards: string[];
readonly pullRequestProcessing: boolean;
readonly pullRequestStaleComment: IComment | '';
Expand Down
Loading

0 comments on commit 7a1197e

Please sign in to comment.