Skip to content

Commit

Permalink
feat(issues): add new input issue-only-with-milestones
Browse files Browse the repository at this point in the history
This new input allows to only process issues containing at least one milestone.
Closes #808
  • Loading branch information
C0ZEN committed Aug 22, 2022
1 parent c3727be commit 8083fa8
Show file tree
Hide file tree
Showing 19 changed files with 557 additions and 91 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ To help us have a clear vision over the workflow and also for you if you are jus
- Check if the input `issue-only-any-assignees` contains some assignees. If this is the case and the issue has at least one assignee matching linked to it, the processing will continue, else the processing will stop.
- Check if the input `issue-only-with-assignees` contains some assignees. If this is the case and the issue has at least one assignee linked to it, the processing will continue, else the processing will stop.
- Check if the input `issue-only-with-project-cards` contains some project cards. If this is the case and the issue has at least one project card linked to it, the processing will continue, else the processing will stop.
- Check if the input `issue-only-with-milestones` contains some milestones. If this is the case and the issue has at least one milestone linked to it, the processing will continue, else the processing will stop.
- Check if the issue has already a stale state (stale label)
- 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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ All the inputs that are used both for issues and pull requests.
| **Milestones** | | |
| [issue-ignore-all-milestones](https://sonia-corporation.github.io/stale/docs/issues/inputs/issue-ignore-all-milestones-input) | Allow to ignore the processing of issues that contains any milestones. | `false` |
| [issue-ignore-any-milestones](https://sonia-corporation.github.io/stale/docs/issues/inputs/issue-ignore-any-milestones-input) | Allow to ignore the processing of issues that contains one of those milestones (multiline). | |
| [issue-only-with-milestones](https://sonia-corporation.github.io/stale/docs/issues/inputs/issue-only-wih-milestones-input) | Only allow the processing of issues that contains at least one milestone. | `false` |
| [issue-only-any-milestones](https://sonia-corporation.github.io/stale/docs/issues/inputs/issue-only-any-milestones-input) | Only allow the processing of issues that contains one of those milestones (multiline). | |
| **Comments** | | |
| [issue-stale-comment](https://sonia-corporation.github.io/stale/docs/issues/inputs/issue-stale-comment-input) | The comment that will be sent once the issue is stale (keep empty to not send a comment). | |
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ inputs:
description: 'Allow to ignore the processing of issues that contains one of those milestones (multiline).'
required: false
default: ''
issue-only-with-milestones:
description: 'Only allow the processing of issues that contains at least one milestone.'
required: false
default: 'false'
issue-only-any-milestones:
description: 'Only allow the processing of issues that contains one of those milestones (multiline).'
required: false
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 @@ -46,6 +46,7 @@ The list of all the inputs.
| **Milestones** | | |
| [issue-ignore-all-milestones](issues/inputs/issue-ignore-all-milestones-input) | Allow to ignore the processing of issues that contains any milestones. | `false` |
| [issue-ignore-any-milestones](issues/inputs/issue-ignore-any-milestones-input) | Allow to ignore the processing of issues that contains one of those milestones (multiline). | |
| [issue-only-with-milestones](issues/inputs/issue-only-with-milestones-input) | Only allow the processing of issues that contains at least one milestone. | `false` |
| [issue-only-any-milestones](issues/inputs/issue-only-any-milestones-input) | Only allow the processing of issues that contains one of those milestones (multiline). | |
| [pull-request-ignore-all-milestones](pull-requests/inputs/pull-request-ignore-all-milestones-input) | Allow to ignore the processing of pull requests that contains any milestones. | `false` |
| [pull-request-ignore-any-milestones](pull-requests/inputs/pull-request-ignore-any-milestones-input) | Allow to ignore the processing of pull requests that contains one of those milestones (multiline). | |
Expand Down
1 change: 1 addition & 0 deletions documentation/docs/06-issues/01-inputs/01-all-inputs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ The list of all issues the inputs.
| **Milestones** | | |
| [issue-ignore-all-milestones](issue-ignore-all-milestones-input) | Allow to ignore the processing of issues that contains any milestones. | `false` |
| [issue-ignore-any-milestones](issue-ignore-any-milestones-input) | Allow to ignore the processing of issues that contains one of those milestones (multiline). | |
| [issue-only-with-milestones](issue-only-with-milestones-input) | Only allow the processing of issues that contains at least one milestone. | `false` |
| [issue-only-any-milestones](issue-only-any-milestones-input) | Only allow the processing of issues that contains one of those milestones (multiline). | |
| **Comments** | | |
| [issue-stale-comment](issue-stale-comment-input) | The comment that will be sent once the issue is stale (keep empty to not send a comment). | |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
id: issue-only-with-milestones-input
title: Issue only with milestones input
description: |
All the information you need to know about the issue only with milestones input.
Including a detailed description and an example.
tags:
- Issues
- Inputs
- Milestones
---

### Input {#input}

Name: `issue-only-with-milestones`
Type: `boolean`
Default value: `false`

### Description {#description}

This input will let you process only the issues that are linked to at least one milestone.
This can be useful when you use the milestones for triage.

### Example {#example}

```yml {6}
# ...
name: Stale
id: stale
uses: sonia-corporation/stale@latest
with:
issue-only-with-milestones: true
```
1 change: 1 addition & 0 deletions src/core/inputs/inputs.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export enum EInputs {
ISSUE_LIMIT_API_QUERIES_COUNT = `issue-limit-api-queries-count`,
ISSUE_ONLY_ANY_ASSIGNEES = `issue-only-any-assignees`,
ISSUE_ONLY_WITH_ASSIGNEES = `issue-only-with-assignees`,
ISSUE_ONLY_WITH_MILESTONES = `issue-only-with-milestones`,
ISSUE_ONLY_WITH_PROJECT_CARDS = `issue-only-with-project-cards`,
ISSUE_ONLY_ANY_MILESTONES = `issue-only-any-milestones`,
ISSUE_ONLY_ANY_PROJECT_CARDS = `issue-only-any-project-cards`,
Expand Down
1 change: 1 addition & 0 deletions src/core/inputs/interfaces/issues-inputs.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface IIssuesInputs extends IInputs {
readonly issueOnlyAnyMilestones: string[];
readonly issueOnlyAnyProjectCards: string[];
readonly issueOnlyWithAssignees: boolean;
readonly issueOnlyWithMilestones: boolean;
readonly issueOnlyWithProjectCards: boolean;
readonly issueProcessing: boolean;
readonly issueStaleComment: IComment | '';
Expand Down
Loading

0 comments on commit 8083fa8

Please sign in to comment.