mirror of
https://github.com/actions/stale.git
synced 2025-12-12 04:57:15 +00:00
feat(options): add new option ignore-updates to stale even with activity (#540)
* chore(assignees): add logs * docs(readme): use the override syntax to simplify the reading * docs(readme): add missing default options * docs(readme): add 3 new options to ignore activity before stale * chore(action): add 3 new options * fix(removeStaleWhenUpdated): use the value of the action config as expected Fixes #451 * chore(main): add 3 new options * feat(ignore): add new class to ignore all activities before stale * feat(option): add new options to ignore all activities before stale * chore(index): update index file * docs(readme): fix typo * docs(readme): add missing empty row * chore(rebase): fix logger issues due to rebase * chore: aplly changes due to rebase * refactor(naming): change the name of the options as suggested * chore(logs): reverse the logs as well * docs(readme): format the table of options * refactor(naming): rename the the options * style(rename): rename more updates wording to activities * build(ci): run the test step as expected for a CI instead of using a real linter with auto fix and the tests verbose as fuck * chore: handle breaking changes due to new changes * refactor(naming): rename and reverse the options * style(tests): use plural for some describe * docs(days-before-stale): list the new option * chore(index): update index file * chore: keep static methods on top * chore(logs): remove useless log
This commit is contained in:
committed by
GitHub
parent
002bc97450
commit
1cdda06bb3
@@ -1,7 +1,7 @@
|
||||
import deburr from 'lodash.deburr';
|
||||
import {Option} from '../enums/option';
|
||||
import {wordsToList} from '../functions/words-to-list';
|
||||
import {IAssignee} from '../interfaces/assignee';
|
||||
import {Assignee} from '../interfaces/assignee';
|
||||
import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options';
|
||||
import {Issue} from './issue';
|
||||
import {IssueLogger} from './loggers/issue-logger';
|
||||
@@ -10,10 +10,6 @@ import {LoggerService} from '../services/logger.service';
|
||||
type CleanAssignee = string;
|
||||
|
||||
export class Assignees {
|
||||
private static _cleanAssignee(assignee: Readonly<string>): CleanAssignee {
|
||||
return deburr(assignee.toLowerCase());
|
||||
}
|
||||
|
||||
private readonly _options: IIssuesProcessorOptions;
|
||||
private readonly _issue: Issue;
|
||||
private readonly _issueLogger: IssueLogger;
|
||||
@@ -24,6 +20,10 @@ export class Assignees {
|
||||
this._issueLogger = new IssueLogger(issue);
|
||||
}
|
||||
|
||||
private static _cleanAssignee(assignee: Readonly<string>): CleanAssignee {
|
||||
return deburr(assignee.toLowerCase());
|
||||
}
|
||||
|
||||
shouldExemptAssignees(): boolean {
|
||||
if (!this._issue.hasAssignees) {
|
||||
this._issueLogger.info('This $$type has no assignee');
|
||||
@@ -195,7 +195,7 @@ export class Assignees {
|
||||
const cleanAssignee: CleanAssignee = Assignees._cleanAssignee(assignee);
|
||||
|
||||
return this._issue.assignees.some(
|
||||
(issueAssignee: Readonly<IAssignee>): boolean => {
|
||||
(issueAssignee: Readonly<Assignee>): boolean => {
|
||||
const isSameAssignee: boolean =
|
||||
cleanAssignee === Assignees._cleanAssignee(issueAssignee.login);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user