* feat(options): simplify config by removing skip stale message options
Closes#405Closes#455
BREAKING CHANGES: remove skip-stale-issue-message and skip-stale-pr-message options. If you used this option, replace it by an empty message for the options stale-issue-message and stale-pr-message
* build(dist): update dist
also lint some files
* docs(readme): update the docs by removing the skip options
* docs(only-labels): enhance the docs and fix duplicate (#341)
* docs(only-labels): remove duplicated option and improve descriptions
a bad rebase happend
* docs(readme): use a multi-line array and remove the optional column
the option column was not helpful since each value is optional
the multi-line array will allow to have a better UI in small devices and basically in GitHub too due to the max-width
* style(readme): break line for the statistics
* docs(readme): add a better description for the ascending option
* docs(action): add missing punctuation
* build(deps-dev): bump @typescript-eslint/eslint-plugin (#342)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.15.2 to 4.16.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.16.1/packages/eslint-plugin)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump @octokit/rest from 18.3.0 to 18.3.2 (#350)
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.3.0 to 18.3.2.
- [Release notes](https://github.com/octokit/rest.js/releases)
- [Commits](https://github.com/octokit/rest.js/compare/v18.3.0...v18.3.2)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* test: add more coverage for the stale label behaviour (#352) (#15)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* test: add more coverage for the stale label behaviour (#352) (#17)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* test: add more coverage for the stale label behaviour (#352) (#18)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat(remove-stale-when-updated): add 2 options for issues and prs
closes#377
also I closed the stale process once the stale label is removed since the following process is regarding the closing and it should simply not occur if no longer stale
* chore(logs): add more logs to understand the process
* chore(logs): highlights more logs and humanize a bit more
* chore(index): update it
* refactor(checks): simplify if complexity
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* docs(only-labels): enhance the docs and fix duplicate (#341)
* docs(only-labels): remove duplicated option and improve descriptions
a bad rebase happend
* docs(readme): use a multi-line array and remove the optional column
the option column was not helpful since each value is optional
the multi-line array will allow to have a better UI in small devices and basically in GitHub too due to the max-width
* style(readme): break line for the statistics
* docs(readme): add a better description for the ascending option
* docs(action): add missing punctuation
* build(deps-dev): bump @typescript-eslint/eslint-plugin (#342)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.15.2 to 4.16.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.16.1/packages/eslint-plugin)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump @octokit/rest from 18.3.0 to 18.3.2 (#350)
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.3.0 to 18.3.2.
- [Release notes](https://github.com/octokit/rest.js/releases)
- [Commits](https://github.com/octokit/rest.js/compare/v18.3.0...v18.3.2)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* test: add more coverage for the stale label behaviour (#352) (#15)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* test: add more coverage for the stale label behaviour (#352) (#17)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* test: add more coverage for the stale label behaviour (#352) (#18)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* feat(any-of-labels): add 2 new options to customize for issues/PRs
closes#371
change this option and only-labels to have tree-logs
* chore(index): update it
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* docs(only-labels): enhance the docs and fix duplicate (#341)
* docs(only-labels): remove duplicated option and improve descriptions
a bad rebase happend
* docs(readme): use a multi-line array and remove the optional column
the option column was not helpful since each value is optional
the multi-line array will allow to have a better UI in small devices and basically in GitHub too due to the max-width
* style(readme): break line for the statistics
* docs(readme): add a better description for the ascending option
* docs(action): add missing punctuation
* build(deps-dev): bump @typescript-eslint/eslint-plugin (#342)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.15.2 to 4.16.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.16.1/packages/eslint-plugin)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump @octokit/rest from 18.3.0 to 18.3.2 (#350)
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.3.0 to 18.3.2.
- [Release notes](https://github.com/octokit/rest.js/releases)
- [Commits](https://github.com/octokit/rest.js/compare/v18.3.0...v18.3.2)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* test: add more coverage for the stale label behaviour (#352) (#15)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* test: add more coverage for the stale label behaviour (#352) (#17)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* test(refactor): use toHaveLength
* feat(statistics): split the processed issues and prs
* feat(statistics): split the new stale issues and prs
* feat(statistics): split the no longer stale issues and prs
* chore(deps): undo upgrade of dependencies
* feat(statistics): split closed issues and prs
* feat(statistics): use the word "items" when something concern both issues and prs
* feat(statistics): split more stats by issues and prs
* feat(statistics): split more stats by issues and prs (final)
* chore(index): update it
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* docs(only-labels): enhance the docs and fix duplicate (#341)
* docs(only-labels): remove duplicated option and improve descriptions
a bad rebase happend
* docs(readme): use a multi-line array and remove the optional column
the option column was not helpful since each value is optional
the multi-line array will allow to have a better UI in small devices and basically in GitHub too due to the max-width
* style(readme): break line for the statistics
* docs(readme): add a better description for the ascending option
* docs(action): add missing punctuation
* build(deps-dev): bump @typescript-eslint/eslint-plugin (#342)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.15.2 to 4.16.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.16.1/packages/eslint-plugin)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* build(deps): bump @octokit/rest from 18.3.0 to 18.3.2 (#350)
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.3.0 to 18.3.2.
- [Release notes](https://github.com/octokit/rest.js/releases)
- [Commits](https://github.com/octokit/rest.js/compare/v18.3.0...v18.3.2)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* test: add more coverage for the stale label behaviour (#352) (#15)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* chore(logs): add logs for the milestones
* chore(errors): use actions error instead of throw errors
* chore(logs): enhance the logs and add some colors
tl;dr: blue for values, megenta for options, white for messages, yellow light for warnings, yellow for milestones and green for success
still a WIP but I wish to confirm this before continuing
@hross is it ok for you?
* chore(index): update the index
* chore(ci): use npm ci instead of npm i
* chore(logs): removed some useless logs
* refactor(issues): remove useless check
* chore(statistics): show the real count of fetched issues
* refactor(operations): use a class to handle the operations left
closes#361
* chore(logs): include the total number of issues in the log for a batch
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* test: add more coverage
* docs: reorder and enhance typo
* docs(contributing): add more information about the npm scripts
* feat(statistics): add simple statistics
* feat(statistics): add more stats
* refactor(issues-processor): remove some options from the constructor
it should have been only useful for the tests
* feat(statistics): add stats for new stale or undo stale issues
* chore(rebase): handle rebase conflicts
* feat(assignees): add new option to avoid stale for assignees
closes#271
* test: add more coverage
* docs: fix readme format issue
* docs: reorder and enhance typo
* docs(contributing): add more information about the npm scripts
* feat(only-labels): add new options to customize it for issues and PR
closes#308
* feat(assignees): add new option to avoid stale for assignees
closes#271
* test: add more coverage
* docs: fix readme format issue
* docs: reorder and enhance typo
* docs(contributing): add more information about the npm scripts
* docs(readme): update the default values to reflect the real applied ones
* feat(close-label): automatically remove it when no longer closed nor locked
closes#278
* feat(assignees): add new option to avoid stale for assignees
closes#271
* test: add more coverage
* docs: fix readme format issue
* docs: reorder and enhance typo
* docs(contributing): add more information about the npm scripts
* refactor: move and rename the interfaces/classes
closes#272
* docs: update the readme and action to describe the new options for milestones
* refactor: split the tests into multiple files
* feat(milestones): add new options to exempt all milestones
* test: add coverage for the default values
* test(milestones): add more coverage (wip)
* test(milestones): add more coverage for the multiple exempt milestones
* test: reduce duplicated code
* test: change some describes
* test: add more coverage
* test: add more coverage
* test: add final coverage
* build(tsc): add missing project flag to build with the right tsconfig
* test(milestones): use each to reduce the complexity of the tests
* chore: fix an eslint issue with prettier on windows
the end of line was wrong each time the os process the files
* docs: move the contribution section to a dedicated file
add more content to help the debug
* chore: make sure the rebase is ok
* Fixed should be stale condition
When different stale period is used for issues and pull requests, this code uses wrong one.
This was probably missed in https://github.com/actions/stale/pull/224Fixes#299
* Add tests for #299
Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>
* feat(exempt): add new options to exempt the milestones
closes#270
* test(milestones): add coverage
* test(issue): add coverage
* chore(rebase): fix all errors due to the rebase
also made some changes regarding the change I made with the lint scripts and prettier. I did not saw that some scripts were already here and I created to more to keep the old ones as well
* test(milestone): add coverage
* chore(index): update index
* fix(checks): remove checks over optional number options
the code was actually handling the case where the values are NaN so it's fine
* docs(readme): add a small precision about the operations-per-run
closes#230
* chore(lint): ignore the lib folder for prettier
* chore(date): add a function to check if a date is valid
* chore(date): add a function to get a humanized date
* chore(date): add a function to check if the date is more recent than
* feat(date): add a start date to ignore old issues and PRs
closes#174
* docs(readme): change the date to match the description
* chore(date): add a better type for the date
* docs(date): add missing JSDoc about the return type
* chore(rebase): fix issues due to rebase
* docs(readme): fix table formatting issues
* refactor(issue): create a dedicated function to remove the stale label
* refactor: prefix private methods with _
to make it consistent with others methods
* feat(label): remove the stale label when labeled with an exempt one
closes#136
* chore: fix logger issues due to rebase
@hross I think there is a room for improvement regarding the class creation of the issue logger (code duplication) but I do not see how to do it without changing a lot of stuff; do you have an idea?
* test: use strict equal and move the new test in a more logical position
* docs(readme): fix parsing error of the default values in the table
prettier was not liking the previous syntax
* docs(readme): add new options in the documentation
* chore: update the action schema
* chore: parse the new arguments
* feat(stale-and-close): add new options to change the days before close
to avoid a breaking change and simplify the configuration the old options 'daysBeforeStale' and 'daysBeforePrClose' are kept and new options are available to override them with 'daysBeforeIssueStale', 'daysBeforePrStale', 'daysBeforeIssueClose' and 'daysBeforePrClose'
* chore: rename the issue type enum to remove the enum suffix
* chore: add missing dependency for eslint and typescript
also upgrade the parser
* chore: fix an issue with the linter for the shadow rules
it was not configured properly for TypeScript
* chore: use camelCase for constants
* chore: use camelCase for enum members
* chore: fix the tests
* chore: enhance prettier to also lint other kind of files
it was configured to only work with ts and it was not working well to be honest
also now the lint scripts will also run prettier
* test: add two more tests relating the label syntax issues
both are failing
* chore: add more logs and fix the tests on error
meaning that I did not find a reproduction...
* chore: minor improvements with the types and logs
* fix(remove-label): do not encode the label to make sure to remove it
could lead to an issue since based on the comment it was here on purpose
This introduces two new flags `skip-stale-issue-message` and `skip-stale-pr-message` which would skip the message addition if these are set to true.
They are backward compatible as empty `stale-issue-message` or `stale-pr-message` will take precedence over them
Previously this action would stop and skip all issues or pull requests
it found if no `stale-issue-message | stale-pr-message` option had
been configured.
Configuring `days-before-stale: -1` will activate that behaviour.
This is to ensure we do not close issues before days-before-close has
expired. Without this fix we can encounter a situation where an issue
gets marked as stale and it gets closed immediately without waiting
days-before-close number of days.
* The bot would un-stale issues because of how it checked staleness
* Made logging info by default so its easier to troubleshoot customer issues/runs
* Updated operation counts
* Ignore issues that have recent comments and ignore the stale label. Defaulting to this behavior but added an option to turn it off.
* Fix up tests a bit to make this runnable. Add a test for the logic.
* Add vscode debugging configuration.