Skip to content

Commit

Permalink
feat(issues): add new input issue-only-with-project-cards
Browse files Browse the repository at this point in the history
This new input allows to only process issues containing at least one project card.
Closes #807
  • Loading branch information
C0ZEN committed Aug 21, 2022
1 parent b3f3557 commit 2c4290e
Show file tree
Hide file tree
Showing 19 changed files with 636 additions and 69 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,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-milestones` contains some milestones. If this is the case and the issue has at least one milestone matching linked to it, the processing will continue, else the processing will stop.
- 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 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 @@ -91,6 +91,7 @@ All the inputs that are used both for issues and pull requests.
| **Project cards** | | |
| [issue-ignore-all-project-cards](https://sonia-corporation.github.io/stale/docs/issues/inputs/issue-ignore-all-project-cards-input) | Allow to ignore the processing of issues that contains any project cards. | `false` |
| [issue-ignore-any-project-cards](https://sonia-corporation.github.io/stale/docs/issues/inputs/issue-ignore-any-project-cards-input) | Allow to ignore the processing of issues that contains one of those project cards (multiline). | |
| [issue-only-with-project-cards](https://sonia-corporation.github.io/stale/docs/issues/inputs/issue-only-wih-project-cards-input) | Only allow the processing of issues that contains at least one project card. | `false` |
| [issue-only-any-project-cards](https://sonia-corporation.github.io/stale/docs/issues/inputs/issue-only-any-project-cards-input) | Only allow the processing of issues that contains one of those project cards (multiline). | |
| **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` |
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ inputs:
description: 'Allow to ignore the processing of issues that contains one of those project cards (multiline).'
required: false
default: ''
issue-only-with-project-cards:
description: 'Only allow the processing of issues that contains at least one project card.'
required: false
default: 'false'
issue-only-any-project-cards:
description: 'Only allow the processing of issues that contains one of those project cards (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 @@ -37,6 +37,7 @@ The list of all the inputs.
| **Project cards** | | |
| [issue-ignore-all-project-cards](issues/inputs/issue-ignore-all-project-cards-input) | Allow to ignore the processing of issues that contains any project cards. | `false` |
| [issue-ignore-any-project-cards](issues/inputs/issue-ignore-any-project-cards-input) | Allow to ignore the processing of issues that contains one of those project cards (multiline). | |
| [issue-only-with-project-cards](issues/inputs/issue-only-with-project-cards-input) | Only allow the processing of issues that contains at least one project card. | `false` |
| [issue-only-any-project-cards](issues/inputs/issue-only-any-project-cards-input) | Only allow the processing of issues that contains one of those project cards (multiline). | |
| [pull-request-ignore-all-project-cards](pull-requests/inputs/pull-request-ignore-all-project-cards-input) | Allow to ignore the processing of pull requests that contains any project cards. | `false` |
| [pull-request-ignore-any-project-cards](pull-requests/inputs/pull-request-ignore-any-project-cards-input) | Allow to ignore the processing of pull requests that contains one of those project cards (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 @@ -24,6 +24,7 @@ The list of all issues the inputs.
| **Project cards** | | |
| [issue-ignore-all-project-cards](issue-ignore-all-project-cards-input) | Allow to ignore the processing of issues that contains any project cards. | `false` |
| [issue-ignore-any-project-cards](issue-ignore-any-project-cards-input) | Allow to ignore the processing of issues that contains one of those project cards (multiline). | |
| [issue-only-with-project-cards](issue-only-with-project-cards-input) | Only allow the processing of issues that contains at least one project card. | `false` |
| [issue-only-any-project-cards](issue-only-any-project-cards-input) | Only allow the processing of issues that contains one of those project cards (multiline). | |
| **Milestones** | | |
| [issue-ignore-all-milestones](issue-ignore-all-milestones-input) | Allow to ignore the processing of issues that contains any milestones. | `false` |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
id: issue-only-with-project-cards-input
title: Issue only with project cards input
description: |
All the information you need to know about the issue only with project cards input.
Including a detailed description and an example.
tags:
- Issues
- Inputs
- Projects
---

### Input {#input}

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

### Description {#description}

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

### Example {#example}

```yml {6}
# ...
name: Stale
id: stale
uses: sonia-corporation/stale@latest
with:
issue-only-with-project-cards: 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_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`,
ISSUE_PROCESSING = `issue-processing`,
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 issueOnlyWithProjectCards: boolean;
readonly issueProcessing: boolean;
readonly issueStaleComment: IComment | '';
readonly issueStaleLabel: string;
Expand Down
Loading

0 comments on commit 2c4290e

Please sign in to comment.