Compare commits

...

277 Commits

Author SHA1 Message Date
Milos Pantic
1160a22402 Merge pull request #965 from actions/dependabot/npm_and_yarn/prettier-2.8.6
build(deps-dev): bump prettier from 2.8.4 to 2.8.6
2023-03-22 09:37:08 +01:00
dependabot[bot]
5f7b396645 build(deps-dev): bump prettier from 2.8.4 to 2.8.6
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.4 to 2.8.6.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.4...2.8.6)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-22 08:30:19 +00:00
Milos Pantic
b002e7ec85 Merge pull request #941 from panticmilos/vmpantic/rebuild-dist-vercel-bump
Rebuild dist for vercel bump
2023-03-22 09:29:33 +01:00
Milos Pantic
52903732a4 Rebuild dist after rebase 2023-03-21 23:39:03 +01:00
Milos Pantic
b006677dea Merge pull request #962 from actions/dependabot/npm_and_yarn/jest-and-types/jest-29.5.0
build(deps-dev): bump jest and @types/jest
2023-03-21 23:22:50 +01:00
Milos Pantic
4f29769aee Merge pull request #961 from actions/dependabot/npm_and_yarn/typescript-5.0.2
build(deps-dev): bump typescript from 4.9.4 to 5.0.2
2023-03-21 23:19:43 +01:00
dependabot[bot]
83453dd842 build(deps-dev): bump jest and @types/jest
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) and [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest). These dependencies needed to be updated together.

Updates `jest` from 29.4.3 to 29.5.0
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.5.0/packages/jest)

Updates `@types/jest` from 29.4.0 to 29.5.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

---
updated-dependencies:
- dependency-name: jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
- dependency-name: "@types/jest"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-21 22:18:55 +00:00
Milos Pantic
79e8c046ed Merge pull request #960 from actions/dependabot/npm_and_yarn/types/node-18.15.3
build(deps-dev): bump @types/node from 18.11.18 to 18.15.3
2023-03-21 23:17:38 +01:00
Milos Pantic
75d4d955ac Remove labels on stale (#959) 2023-03-21 14:11:19 +01:00
dependabot[bot]
fac2d41a88 build(deps-dev): bump typescript from 4.9.4 to 5.0.2
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.9.4 to 5.0.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.9.4...v5.0.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-20 08:20:54 +00:00
dependabot[bot]
f8de0d2c00 build(deps-dev): bump @types/node from 18.11.18 to 18.15.3
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.11.18 to 18.15.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-20 08:20:50 +00:00
Sergey Dolin
01aa53266c Merge pull request #935 from akv-platform/invalid-creds2
abort the build on the error
2023-03-20 09:19:34 +01:00
github-actions[bot]
326b913d3a Update configuration files (#953)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-15 00:35:16 +01:00
Sergey Dolin
1226ccf00a Resolve conflicts 2023-03-13 19:39:37 +01:00
Sergey Dolin
fd837a17e5 Resolve changes requests 2023-03-13 19:39:37 +01:00
Sergey Dolin
b5b320bc53 fix licenses 2023-03-13 19:39:37 +01:00
Sergey Dolin
21a8be8320 upgrade to node 16 2023-03-13 19:39:35 +01:00
Sergey Dolin
50cb17ba49 force v12 2023-03-13 19:35:44 +01:00
Sergey Dolin
6bc202284c abort the build on the error 2023-03-13 19:35:42 +01:00
Marko Zivic
7769eadff1 Merge pull request #952 from akv-platform/reusable-workflow
Turn on automatic update of ESLint and Prettier configuration files
2023-03-10 10:56:23 +01:00
IvanZosimov
62c703ecbb Add update-config-files.yml 2023-03-09 13:59:40 +01:00
Ivan
47a58a6ddf Configure ESLint and update configuration for Prettier (#949)
* Update ESLint and Prettier configurations

* Rebuild action

* Update package.json
2023-03-09 14:57:55 +02:00
Milos Pantic
3d90444e57 Merge pull request #942 from actions/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-5.53.0
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.48.1 to 5.53.0
2023-02-21 16:37:36 +01:00
dependabot[bot]
d8dd192a23 build(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.48.1 to 5.53.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.53.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-21 15:27:52 +00:00
Milos Pantic
7e0fd29df2 Merge pull request #939 from actions/dependabot/npm_and_yarn/typescript-eslint/parser-5.52.0
build(deps-dev): bump @typescript-eslint/parser from 5.48.1 to 5.52.0
2023-02-21 16:26:31 +01:00
Milos Pantic
6e0e3b563a Merge pull request #937 from actions/dependabot/npm_and_yarn/prettier-2.8.4
build(deps-dev): bump prettier from 2.8.2 to 2.8.4
2023-02-21 16:23:56 +01:00
Milos Pantic
5ed25fd44f Merge pull request #925 from actions/dependabot/npm_and_yarn/jest-and-types/jest-29.4.1
build(deps-dev): bump jest and @types/jest
2023-02-21 16:18:44 +01:00
dependabot[bot]
e9515006d2 build(deps-dev): bump @typescript-eslint/parser from 5.48.1 to 5.52.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.48.1 to 5.52.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.52.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-20 11:57:52 +00:00
dependabot[bot]
a791a2919f build(deps-dev): bump prettier from 2.8.2 to 2.8.4
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.2 to 2.8.4.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.2...2.8.4)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-13 11:57:54 +00:00
Ivan
6fa13d7b00 Update workflow badges (#924) 2023-01-31 08:47:47 +02:00
dependabot[bot]
1d96fcfd44 build(deps-dev): bump jest and @types/jest
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) and [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest). These dependencies needed to be updated together.

Updates `jest` from 29.3.1 to 29.4.1
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.4.1/packages/jest)

Updates `@types/jest` from 27.0.2 to 29.4.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

---
updated-dependencies:
- dependency-name: jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
- dependency-name: "@types/jest"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 11:01:05 +00:00
Sergey Dolin
c4a13d8dca Merge pull request #913 from akv-platform/v-sdolin/push-ref
Skip deleting the branch in the upstream of a forked repo
2023-01-26 08:58:51 +01:00
Sergey Dolin
04ed84ed9f Fix test 2023-01-24 07:48:55 +00:00
Sergey Dolin
c933d5be9d Build dist 2023-01-24 07:40:40 +00:00
Sergey Dolin
dad3c0f9e0 Skip deleting the branch in the upstream of a forkerd repo 2023-01-24 07:40:23 +00:00
Ivan
a8c816994c Bump npm dependencies (#915)
* Update dependencies

* Update semver dependency license
2023-01-17 10:54:58 +02:00
MaksimZhukov
ad32062f75 Update release-new-action-version.yml (#914) 2023-01-12 13:51:59 +01:00
dependabot[bot]
b1e5ead0b2 build(deps): bump json5 from 1.0.1 to 1.0.2 (#907)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-06 17:20:40 +01:00
Zack Koppert
0d675cc205 Switch examples to reference the v7 release (#905) 2023-01-05 16:23:19 +01:00
Marko Zivic
faa6c150f0 Merge pull request #892 from actions/update-codeowners-setup-actions-team
Update CODEOWNERS
2022-12-27 09:27:30 +01:00
Evgenii Korolevskii
65faf86995 Update CODEOWNERS 2022-12-26 09:43:55 +01:00
Marko Zivic
95d18187c1 Merge pull request #891 from actions/update-codeowners
Update CODEOWNERS
2022-12-23 08:26:55 +01:00
Evgenii Korolevskii
78d80e2378 Update CODEOWNERS 2022-12-23 00:06:12 +01:00
Ivan
b43f1bcb15 Merge pull request #886 from akv-platform/apply-reusable-workflows
Update action to use reusable workflows
2022-12-22 11:08:14 +02:00
IvanZosimov
5325f2f14e Merge branch 'main' into apply-reusable-workflows 2022-12-22 10:00:56 +01:00
John Sudol
6f05e4244c draft release for v7.0.0 (#888) 2022-12-20 16:09:39 -05:00
John Sudol
eed91cbd05 Update how stale handles exempt items (#874) 2022-12-20 15:35:06 -05:00
IvanZosimov
942bb868e3 Run prettier, format code 2022-12-20 17:04:59 +01:00
IvanZosimov
b23acf1dc9 Fix review points 2022-12-20 16:59:39 +01:00
IvanZosimov
aab1763e57 Update npm all:ci script 2022-12-19 14:24:45 +01:00
IvanZosimov
7dfab7a600 Update action to use reusable-workflows repo 2022-12-19 14:13:43 +01:00
IvanZosimov
0f49addb38 Add links to reusable workflows 2022-12-15 16:22:18 +01:00
IvanZosimov
f14a81872b Update workflows 2022-12-15 16:17:42 +01:00
IvanZosimov
a19292a05f Update codeql-analysis.yml 2022-12-15 15:01:24 +01:00
IvanZosimov
b7dd7fb519 Update package-lock.json 2022-12-15 14:37:48 +01:00
IvanZosimov
f903b06fcc Update codeql-analysis.yml 2022-12-15 14:24:12 +01:00
IvanZosimov
cd268b199d Update codeql-analysis.yml 2022-12-15 14:22:37 +01:00
IvanZosimov
6d0109286a Update workflows to use reusable-workflows 2022-12-15 13:47:58 +01:00
Ivan
10dc265f2c Merge pull request #880 from akv-platform/update-stale-repo
Update issue and PR templates, add/delete workflow files
2022-12-15 13:25:09 +02:00
IvanZosimov
9c1eb3ff7e Update .md files and allign build-test.yml with the current test.yml 2022-12-14 17:39:32 +01:00
Ivan
bc357bdd1b Update .github/workflows/release-new-action-version.yml
Co-authored-by: MaksimZhukov <46996400+MaksimZhukov@users.noreply.github.com>
2022-12-14 18:32:38 +02:00
Ivan
690ede5a62 Update .github/ISSUE_TEMPLATE/bug_report.md
Co-authored-by: MaksimZhukov <46996400+MaksimZhukov@users.noreply.github.com>
2022-12-14 18:31:43 +02:00
IvanZosimov
afbcabf8c3 Merge branch 'main' into update-stale-repo 2022-12-14 14:32:24 +01:00
IvanZosimov
e364411631 Update name of codeql.yml file 2022-12-14 14:30:03 +01:00
Iván Reinoso García
627cef3f37 fix print outputs step (#859) 2022-12-13 15:31:07 +01:00
Ivan
975308fb9d Merge pull request #876 from jongwooo/chore/use-cache-in-check-dist
Use cache in check-dist.yml
2022-12-08 15:36:21 +02:00
IvanZosimov
97a008721c Update licenses, run prettier on yml files 2022-12-08 14:14:09 +01:00
IvanZosimov
161093d861 Update the repo to the standards of maintaining team
In scope of this commit issues and PR temlates were updated, some
workflows were renamed and partly updated, some workflows such as
release-new-action-version.yml and licensed.yml were added.
The stale.yml workflow was deleted as it was considered as harmful
and inconvenient.
2022-12-08 13:27:13 +01:00
Jongwoo Han
f6a9b6accf Use cache in check-dist.yml
Signed-off-by: jongwooo <jongwooo.han@gmail.com>
2022-12-07 00:59:54 +09:00
Iván Reinoso García
65b52aff67 Allow daysBeforeStale options to be float (#841)
* feat: allow daysBeforeStale options to be float

* update dist
2022-10-19 12:08:31 +02:00
Francesco Renzi
0d6f830071 Update changelog for 6.0.1 2022-10-07 11:12:02 +01:00
Francesco Renzi
b909bf8927 Merge pull request #839 from actions/rentziass/update-actions-core
Update @actions/core to 1.10.0
2022-10-07 11:05:38 +01:00
Francesco Renzi
5ebf00ea0e Update @actions/core to 1.10.0 2022-10-06 12:19:32 +01:00
Luke Tomlinson
3de2653986 Update changelog for v6.0.0 (#829)
* Update changelog for v6.0.0

* whitespace
2022-09-21 14:54:43 -04:00
David Allison
02e44c81cc fix(options)!: Make not_planned the default close-issue-reason (#807)
* docs: add source for default testing options

* fix(options)!: Default to 'Close as not planned'

GitHub introduced an additional close reason 'Close as not planned':
https://github.blog/changelog/2022-05-19-the-new-github-issues-may-19th-update/

'stale' is a use case for this close reason

Fixes #789

BREAKING CHANGE:
`close-issue-reason` defaults to `not_planned` (previously: ``
which defaulted to `completed`)
This closes the issue as 'not planned' on GitHub rather than 'completed'

See: https://github.blog/changelog/2022-05-19-the-new-github-issues-may-19th-update
2022-09-20 14:01:22 -04:00
JoannaaKL
99b6c70959 Add include-only-assigned to the action.yml (#824) 2022-09-12 17:39:44 +02:00
Luke Tomlinson
8e8a0e6680 [Bugfix-795] Fix date comparison edge case (#816)
* Fix updatedAt and markedStaleOn date comparison

* Delete accidental file

* Refactor

* Cleanup

* cleanup
2022-09-12 09:38:46 -04:00
JoannaaKL
80962c1062 Update README.md (#821)
* Update README.md

* Update README.md

Co-authored-by: Tatyana Kostromskaya <32135588+takost@users.noreply.github.com>

Co-authored-by: Tatyana Kostromskaya <32135588+takost@users.noreply.github.com>
2022-09-12 14:41:28 +02:00
JoannaaKL
3e4418e47e Issue 596/include only assigned (#817)
* Add new 'include-only-assigned' option

If set, only issues containing assignees will be processed

* Test new flag

* Update code comment

* Update src/classes/issues-processor.ts

Co-authored-by: Francesco Renzi <rentziass@github.com>

* Update index.js with typo fix

Co-authored-by: Francesco Renzi <rentziass@github.com>
2022-09-12 13:20:57 +02:00
Luke Tomlinson
33e37032bb Update actions core to 1.9.1 (#812)
* Update @actions/core to 1.9.1

* Update dist/

* Fix conflicts
2022-09-07 11:23:27 -04:00
Luke Tomlinson
97911cb595 Update package.lock version (#811) 2022-09-07 11:17:21 -04:00
Dan Pavlov
65afee970e docs(readme): add missing permission for delete-branch option in readme (#796) 2022-09-07 11:16:55 -04:00
dependabot[bot]
48bae5932f build(deps): bump actions/setup-node from 1 to 3 (#761)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 1 to 3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-29 16:28:44 -04:00
Luke Tomlinson
2b58cc900f Fix issue when days-before-close is more than days-before-stale (#775) 2022-07-25 09:24:15 -04:00
Luke Tomlinson
532554b8a8 update Changelog 2022-07-15 09:08:35 -04:00
Zhongxiang Wang
aaab997cce fix(options): add missing close-issue-reason option (#772) 2022-07-11 13:49:18 -04:00
timsu92
136efb520f docs: update example with new version of stale (#765) 2022-06-24 10:09:05 -04:00
Jacob Bandes-Storch
06d2a3904b Add close-issue-reason option (#764)
* Add close-as-not-planned option

* update readme

* add to Option enum

* improve wording

* npm run pack

* updates from review

* fix tests and improve error message

* fix readme order
2022-06-23 17:43:36 -04:00
0x5c
29e800e1c8 Remove stale when updated without comment (#717)
The existing logic for `remove-stale-when-updated` only considers presence of
comments, ignoring the value of `issueHasUpdate`.

This commits fixes it so it follows the documented behaviour for that setting.

Fixes #715
2022-06-20 15:38:43 -04:00
dependabot[bot]
6b7f9717b7 build(deps): bump github/codeql-action from 1 to 2 (#760)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-20 13:50:11 -04:00
Luke Tomlinson
6c298b192c Update CONTRIBUTING.md 2022-06-20 13:49:18 -04:00
Luke Tomlinson
c048b97ed3 Update CONTRIBUTING.md 2022-06-20 13:48:36 -04:00
dependabot[bot]
71b06d0194 build(deps): bump actions/upload-artifact from 2 to 3 (#762)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-20 13:44:43 -04:00
dependabot[bot]
7bb514d8f8 build(deps): bump actions/checkout from 2 to 3 (#763)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-20 13:43:45 -04:00
Adam Stachowicz
a78f1809b1 Fix spaces in issues-processor.ts (#748)
* Fix spaces in `issues-processor.ts`

* `npm run build` and `npm run pack`
2022-06-20 13:43:08 -04:00
Cory Miller
e577b690d3 Merge pull request #733 from flaxel/main
🔧  Add GitHub Actions Dependabot
2022-06-20 13:22:54 -04:00
Cory Miller
736a97ebc6 Merge branch 'main' into main 2022-06-20 13:19:34 -04:00
Parker Brown
b9ccbf0648 Change NPM version update interval (daily → weekly)
Checking daily results in a lot of closed PRs because new PRs supersede them before they are reviewed and merged.
2022-06-20 13:03:36 -04:00
Falk Puschner
69c1cc9976 🚨 fix lint issue 2022-06-13 21:47:14 +02:00
Falk Puschner
8c947ce781 🎨 change interval
Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com>
2022-06-13 21:44:08 +02:00
Falk Puschner
4b36ad56cb 💚 run prettier 2022-05-11 13:00:09 +02:00
Falk Puschner
64112b01cc 🎨 fix yaml 2022-05-11 12:38:17 +02:00
Falk Puschner
d693f556ca 🎨 improve dependabot 2022-05-11 12:36:54 +02:00
Luke Tomlinson
65d24b7092 Don't process a stale issue in the same run it's marked stale (#696) 2022-04-29 10:07:39 -04:00
dependabot[bot]
57708ae6dd build(deps): bump ajv from 6.12.0 to 6.12.6 (#675)
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.12.0 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](https://github.com/ajv-validator/ajv/compare/v6.12.0...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-31 15:43:31 -04:00
Luke Tomlinson
a88f7b30b9 Update @actions/github to 5.0.1 (#707)
* Update github package

* Update dist

* Use @actions/github@5.0.1

* Cleanup

* More cleanup
2022-03-31 15:38:16 -04:00
dependabot[bot]
74dfff0835 build(deps): bump minimist from 1.2.5 to 1.2.6 (#700)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-30 09:18:49 -04:00
Thomas Boop
3cc1237663 Merge pull request #670 from actions/thboop/node16upgrade
Update default runtime to node16
2022-02-28 16:18:50 -05:00
Thomas Boop
76e9fbc6ae update node version 2022-02-10 14:40:59 -05:00
Thomas Boop
6467b96231 Update default runtime to node16
Node 12 has an end of life on April 30, 2022.

This PR updates the default runtime to [node16](https://github.blog/changelog/2021-12-10-github-actions-github-hosted-runners-now-run-node-js-16-by-default/), rather then node12. 

This is supported on all Actions Runners v2.285.0 or later.
2022-02-07 14:05:30 -05:00
dependabot[bot]
8af60513da build(deps-dev): bump jest-circus from 27.2.0 to 27.4.6 (#665)
Bumps [jest-circus](https://github.com/facebook/jest/tree/HEAD/packages/jest-circus) from 27.2.0 to 27.4.6.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v27.4.6/packages/jest-circus)

---
updated-dependencies:
- dependency-name: jest-circus
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-04 09:55:05 -05:00
m.bell
7a7efcae1f Fix per issue operation count (#662)
* Fix per issue operation count

* Run pack
2022-02-04 09:54:35 -05:00
dependabot[bot]
04a1828bc1 build(deps-dev): bump ts-jest from 27.0.5 to 27.1.2 (#641)
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 27.0.5 to 27.1.2.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v27.0.5...v27.1.2)

---
updated-dependencies:
- dependency-name: ts-jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-29 19:52:14 +03:00
dependabot[bot]
65ca3956bd build(deps-dev): bump eslint-plugin-jest from 24.4.2 to 25.3.2 (#639)
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 24.4.2 to 25.3.2.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v24.4.2...v25.3.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-jest
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-29 16:55:51 +03:00
dependabot[bot]
eee276c280 build(deps-dev): bump prettier from 2.4.1 to 2.5.1 (#628)
Bumps [prettier](https://github.com/prettier/prettier) from 2.4.1 to 2.5.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.4.1...2.5.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-29 14:23:59 +03:00
MaksimZhukov
6c2f9f3f54 Merge pull request #640 from dmitry-shibanov/v-dmshib/fix-check-dist
Fix check-dist.yml
2021-12-29 13:36:23 +03:00
Dmitry Shibanov
37323f14dd fix check-dist.yml 2021-12-29 12:56:54 +03:00
Luke Tomlinson
3be940e59b Merge pull request #627 from actions/prep-release
Bump release to 4.1.0
2021-12-10 15:00:13 -05:00
Luke Tomlinson
7d0e5bedbf Fix formatting check 2021-12-10 14:54:39 -05:00
Luke Tomlinson
77bfb89501 Update changelog 2021-12-10 14:42:33 -05:00
Luke Tomlinson
7fb802b307 Bump release to 4.1.0 2021-12-10 14:28:19 -05:00
Luke Tomlinson
54197c7137 Merge pull request #602 from actions/revert-breaking-change
Revert "Merge pull request #586 from C0ZEN/feature/split-pr-and-issue…
2021-10-20 09:40:28 -04:00
Luke Tomlinson
3a971aeb80 Revert "Merge pull request #586 from C0ZEN/feature/split-pr-and-issue-options"
This reverts commit db699ab3b1, reversing
changes made to b83d488cb9.
2021-10-20 09:25:24 -04:00
Luke Tomlinson
fc4a5ff942 Merge pull request #595 from actions/dependabot/npm_and_yarn/types/jest-27.0.2
build(deps-dev): bump @types/jest from 27.0.1 to 27.0.2
2021-10-19 13:31:19 -04:00
Luke Tomlinson
db699ab3b1 Merge pull request #586 from C0ZEN/feature/split-pr-and-issue-options
feat(options): remove common options between the issues and PRs
2021-10-19 13:30:46 -04:00
dependabot[bot]
f8e08de81b build(deps-dev): bump @types/jest from 27.0.1 to 27.0.2
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 27.0.1 to 27.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

---
updated-dependencies:
- dependency-name: "@types/jest"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-14 11:02:03 +00:00
Luke Tomlinson
b83d488cb9 Update dependencies (#592) 2021-10-13 11:42:09 -04:00
dependabot[bot]
1ff6cd74cb build(deps): bump tmpl from 1.0.4 to 1.0.5 (#575)
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-13 09:02:38 -04:00
dependabot[bot]
86fed0e1f1 build(deps-dev): bump jest-silent-reporter from 0.4.0 to 0.5.0 (#573)
Bumps [jest-silent-reporter](https://github.com/rickhanlonii/jest-silent-reporter) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/rickhanlonii/jest-silent-reporter/releases)
- [Commits](https://github.com/rickhanlonii/jest-silent-reporter/compare/0.4.0...0.5.0)

---
updated-dependencies:
- dependency-name: jest-silent-reporter
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-13 09:02:17 -04:00
TESTELIN Geoffrey
67004407a6 docs(readme): split the options between common, issues and prs 2021-10-08 22:42:12 +02:00
TESTELIN Geoffrey
b9a40762bf feat: remove the remove-stale-when-updated option
BREAKING CHANGE:
The option remove-stale-when-updated was removed
2021-10-08 21:30:39 +02:00
TESTELIN Geoffrey
bab816b473 feat: remove the days-before-stale option
BREAKING CHANGE:
The option days-before-stale was removed
2021-10-08 21:06:12 +02:00
TESTELIN Geoffrey
6299c36a0d feat: remove the only-labels option
BREAKING CHANGE:
The option only-labels was removed
2021-10-08 20:39:44 +02:00
TESTELIN Geoffrey
a8c5bb1c29 feat: remove the only-labels option
BREAKING CHANGE:
The option only-labels was removed
2021-10-08 20:26:58 +02:00
TESTELIN Geoffrey
1c81c38e2f feat: remove the any-of-labels option
BREAKING CHANGE:
The option any-of-labels was removed
2021-10-08 20:18:01 +02:00
TESTELIN Geoffrey
f6a70aa856 feat: remove the exempt-milestones option
BREAKING CHANGE:
The option exempt-milestones was removed
2021-10-08 19:48:38 +02:00
TESTELIN Geoffrey
315391885d feat: remove the exempt-all-milestones option
BREAKING CHANGE:
The option exempt-all-milestones was removed
2021-10-08 19:19:07 +02:00
TESTELIN Geoffrey
4665995b65 feat: remove the exempt-assignees option
BREAKING CHANGE:
The option exempt-assignees was removed
2021-10-08 19:06:51 +02:00
TESTELIN Geoffrey
b80ae639fa feat: remove the exempt-all-assignees option
BREAKING CHANGE:
The option exempt-all-assignees was removed
2021-10-08 18:50:37 +02:00
TESTELIN Geoffrey
3021a55a47 feat: remove the ignore-updates option
BREAKING CHANGE:
The option ignore-updates was removed
2021-10-08 18:06:39 +02:00
Geoffrey Testelin
b98591d49e docs(stale-issue-comment): update the docs to remove that omitting the option will not send a message (#522)
* chore(assignees): add logs

* docs(stale-issue-comment): update the docs to remove that omitting will not send a message

To be sure, what would be even better is to add a test using the default config (because the main issue is that the default options of the specs are not matching the ones from the action).

Closes #521

* test(comment): add more coverage to test the stale issue message

* docs(readme): improve the wording

Co-authored-by: Luke Tomlinson <luketomlinson@github.com>

* refactor: simplify the code to use the stats for the specs

* chore(rebase): fix rebase issue

* chore(statistics): fix issue due to rebase

Co-authored-by: Luke Tomlinson <luketomlinson@github.com>
2021-09-22 09:18:19 -04:00
Geoffrey Testelin
9912fa74d1 feat(draft-pr): add new option to not process PRs which are in draft (#539)
* chore(assignees): add logs

* feat(draft-pr): add new option to not process PRs which are in draft

* refactor(draft-pr): create a dedicated class to handle the logic

* chore(index): update index file
2021-09-20 09:37:32 -04:00
dependabot[bot]
303465a5d2 build(deps-dev): bump eslint-plugin-jest from 24.3.6 to 24.4.2 (#570)
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 24.3.6 to 24.4.2.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v24.3.6...v24.4.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-17 14:24:25 -04:00
JamieDanielson
dee9af8160 Fix ISO format on start-date in README (#562) 2021-09-17 14:23:49 -04:00
dependabot[bot]
31d06d7a0a build(deps-dev): bump prettier from 2.3.1 to 2.4.1 (#568)
Bumps [prettier](https://github.com/prettier/prettier) from 2.3.1 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.1...2.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-17 14:16:45 -04:00
dependabot[bot]
fcb25faea2 build(deps-dev): bump @typescript-eslint/parser from 4.26.1 to 4.31.1 (#567)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.26.1 to 4.31.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.31.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-17 14:16:29 -04:00
dependabot[bot]
9dee5c72d9 build(deps-dev): bump @typescript-eslint/eslint-plugin (#566)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.26.0 to 4.31.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.31.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-17 09:57:08 -04:00
dependabot[bot]
0aa6030913 build(deps-dev): bump jest-circus from 26.6.3 to 27.2.0 (#565)
Bumps [jest-circus](https://github.com/facebook/jest/tree/HEAD/packages/jest-circus) from 26.6.3 to 27.2.0.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v27.2.0/packages/jest-circus)

---
updated-dependencies:
- dependency-name: jest-circus
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-17 09:56:55 -04:00
dependabot[bot]
5aa0d3ef84 build(deps-dev): bump @types/jest from 26.0.23 to 27.0.1 (#549)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.23 to 27.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

---
updated-dependencies:
- dependency-name: "@types/jest"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-17 09:56:39 -04:00
Geoffrey Testelin
1cdda06bb3 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
2021-09-17 09:54:38 -04:00
Marko Kungla
002bc97450 add missing inputs to action.yml closes #551 (#554) 2021-09-14 10:13:17 -04:00
Falk Puschner
2e221262b1 docs(readme): add branch hint (#532)
* docs(readme): add branch hint

* using english words

Co-authored-by: Luke Tomlinson <luketomlinson@github.com>

Co-authored-by: Luke Tomlinson <luketomlinson@github.com>
2021-09-08 13:40:19 -04:00
Brian Cristante
27d80e173f Create check-dist.yml (#553)
* Add check-dist.yml

* Fix triggers in licensed.yml

* Remove licensed.yml
2021-09-08 13:39:27 -04:00
Falk Puschner
86507610fb 🎨 improve changelog (#531) 2021-07-15 09:55:05 -04:00
Falk Puschner
ceeedec52e 🔥 using v4 & remove token (#530) 2021-07-15 09:48:15 -04:00
dependabot[bot]
0156089d02 Merge pull request #479 from actions/dependabot/npm_and_yarn/vercel/ncc-0.28.6 2021-07-14 18:31:11 +00:00
Luke Tomlinson
cdf15f641a Prep for v4 (#510)
* Update dist for v4 release

* Create CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* Update CHANGELOG.md

* Update index.js

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>
2021-07-14 10:21:39 -04:00
Luke Tomlinson
a78d0b721e Make label comparison case insensitive (#517)
* Make label comparison case insensitive

* PR Feedback
2021-07-12 13:56:58 -04:00
Luke Tomlinson
d901397e11 Filter comments by content instead of actor (#519)
* Filter comments by content instead of actor

* Remove dead actor code

* WIP fix tests

* Fix test
2021-07-12 10:37:47 -04:00
Geoffrey Testelin
678bfc7a59 docs(readme): update the permissions docs to reflect the requirements of the default config (#512)
Fixes #511
2021-06-24 16:30:27 -04:00
Geoffrey Testelin
d3bfc50685 Revert "feat(options): add new options to avoid stale base on comments (#494)" (#507)
This reverts commit 1efddcbe9f.
2021-06-15 17:16:31 -04:00
dependabot[bot]
4b47cddc05 build(deps-dev): bump @vercel/ncc from 0.27.0 to 0.28.6
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.27.0 to 0.28.6.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.27.0...0.28.6)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-14 14:09:26 +00:00
dependabot[bot]
f2ae27a59b build(deps-dev): bump @typescript-eslint/parser from 4.22.1 to 4.26.1 (#496)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.22.1 to 4.26.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.26.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-14 10:07:58 -04:00
dependabot[bot]
4d1e45b796 build(deps-dev): bump typescript from 4.2.4 to 4.3.2 (#490)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.4 to 4.3.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.2.4...v4.3.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-14 10:07:33 -04:00
Falk Puschner
92d4fc69d8 📝 Add requested permissions (#492)
* 📝 add requested permissions

* 📝 add minor improvement

* 📝 add required/recommended perimissions

* 📝 fix typo

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* 📝 update recommended permissions

* 📝 update required permissions

* 📝 change permissions

* 📝 update recommended permissions

* ✏️ remove typo

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>
2021-06-14 10:05:16 -04:00
Geoffrey Testelin
1efddcbe9f feat(options): add new options to avoid stale base on comments (#494)
* feat(options): add new options to avoid stale based on comments

Helping to close #441, #470, #435?
Closes #390 due to no activity

BREAKING CHANGES: the options related to remove-stale-when-updated will only check the updates, not the comment. It is only impactint the configurations using the value at false

* style(readme): fix table syntax due to rebase

* docs(readme): add permissions only for the new options
2021-06-14 09:56:55 -04:00
Geoffrey Testelin
f1017f33dd fix(dry-run): forbid mutations in dry-run (#500)
Bring back the dry-run by default for the tests - bad idea to disable it sorry
Fix bad documentation array format
Fixes #499
2021-06-10 10:14:45 -04:00
Ben Villalobos
b1da9e1fb1 Add support for adding & removing labels when no longer stale (#468)
* Add support for adding & removing labels when no longer stale

* Add remove/addLabelsWhenUpdatedFromStale to relevant spec files. Modify arguments to remove ambiguity in 'labels' var & parameter

* Change parameters for clarity, let autoformat do its thing

* PR feedback: More useful logging when removing labels

* Wrap client calls in try catches

* Use Unstale in variable names

* Don't run add label logic under debug

* Add test for labels added to unstale issues

* PR Feedback: logging

* Update README

* Rename vars to labels-to-add/remove-when-unstale

* Apply doc suggestions from code review

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* PR Feedback

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>
2021-06-08 09:31:20 -04:00
Falk Puschner
52f5648db3 🎨 Add message grouping (#483)
* 🎨 add message grouping

* ⚗️ try output

* 🔥 remove unnecessary code

* ⬆️ bump deps

* 🎨 build project

* ⬆️ bump deps

* 🎨 formatting code

* ⬇️ revert bumps

* 🎨 using logger service

* 🎨 using package lock version 1

* 🎨 add engines keyword

* ♻️ create processIssue method

*  add grouping method

* 🎨 build project

* 🎨 update engine declaration

* 💚 fix merge conflicts
2021-06-07 17:22:55 -04:00
Geoffrey Testelin
5f6f311ca6 fix(operations): fail fast the current batch to respect the operations limit (#474)
* fix(operations): fail fast the current batch to respect the operations limit

Instead of processing an entire batch of 100 issues before checking the operations left, simply do it before processing an issue so that we respect as expected the limitation of the operations per run
Fixes #466

* test(debug): disable the dry-run for the test by default

we will be able to test the operations per run and have more complete logs that could help us debug the workflow

* chore(logs): also display the stats when the operations per run stopped the workflow

* chore(stats): fix a bad stats related to the consumed operations

* test(operations-per-run): add coverage

* chore: update index
2021-06-07 15:20:11 -04:00
dependabot[bot]
8deaf75055 build(deps-dev): bump eslint from 7.21.0 to 7.28.0 (#486)
Bumps [eslint](https://github.com/eslint/eslint) from 7.21.0 to 7.28.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.21.0...v7.28.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-07 11:02:21 -04:00
dependabot[bot]
50571d3fa3 build(deps-dev): bump prettier from 2.2.1 to 2.3.1 (#485)
Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.2.1...2.3.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-07 10:59:57 -04:00
Geoffrey Testelin
77a1abc9e8 chore(logs): add more logs and better dry-run (#463)
* feat(logs): improve the logs when removing the close label

A log was missing when the option was configured but the close label was not present on the issue/PR
Change the log about not removing the close label to explicitly mention that this behaviour occur because the option is not configured
Fixes #462

* feat(dry-run): display the logs and count the operations

the dry-run checks were cancelling way sooner the workflow
the logs and the count of operations could not occur in dry run due to this
the goal of the dry run is just to skip some logic regarding the api calls to avoid altering the repos but the goal IMO is to also make them reflect the real world run so this change allow this
BTW it also allow now to test the consumed operations
Fixes #461

* feat(logs): add more logs to debug the stale label removal

* chore(index): update index

* chore(dry-run): fix bad dry-run conditions
2021-06-07 09:49:49 -04:00
Ori Arditi
965862c5a6 minor fix (#487) 2021-06-07 09:27:59 -04:00
Falk Puschner
8e70fa8dee 🎨 Print outputs (#484)
* 🎨 print outputs

* 🎨 add missing identifier

* 🎨 capitalize step names
2021-06-07 08:56:40 -04:00
dependabot[bot]
9a928a1355 build(deps-dev): bump js-yaml from 4.0.0 to 4.1.0 (#448)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.0.0...4.1.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-04 16:47:10 -04:00
dependabot[bot]
39b3616748 build(deps): bump ws from 7.4.0 to 7.4.6 (#471)
Bumps [ws](https://github.com/websockets/ws) from 7.4.0 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.0...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-04 16:45:30 -04:00
dependabot[bot]
4310353e56 build(deps-dev): bump @types/jest from 26.0.20 to 26.0.23 (#478)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.20 to 26.0.23.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

---
updated-dependencies:
- dependency-name: "@types/jest"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-03 13:45:19 -04:00
dependabot[bot]
1e82956100 build(deps-dev): bump @typescript-eslint/eslint-plugin (#472)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.16.1 to 4.26.0.
- [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.26.0/packages/eslint-plugin)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-03 10:11:37 -04:00
dependabot[bot]
2347805002 build(deps-dev): bump ts-jest from 26.5.3 to 26.5.6 (#446)
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 26.5.3 to 26.5.6.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v26.5.3...v26.5.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-03 10:11:00 -04:00
Falk Puschner
3e6d35b685 feat(output): print output parameters (#458)
*  print output parameters

* 📝 add output table

* ⚗️ try output parameters

* ⚗️ stringify output

* ⚗️ try test output

* 🔥 remove test output

* 💚 build and lint code

* 🔥 remove output test

* 🔒 fix vulnerabilities

* 🎨 renaming staled variables

* 🎨 build code

* 📝 update contributing commands
2021-06-03 09:18:48 -04:00
Bryan Jenks
1648064648 use YAML comment syntax for comment in code chunk (#469) 2021-06-02 18:01:01 -04:00
Geoffrey Testelin
c2acfb4dd3 chore(release): provide a way to create a local release with less grunt work (#429)
* docs(contributing): add information to update the changelog

* docs(changelog): add a first draft

it needs to contain the new PRs and only contains a not very nice version of the previous release to have an example

* chore(release): propose a way to locally generate a release
2021-06-02 17:06:55 -04:00
Geoffrey Testelin
5fbbfba142 fix(logs): coloured logs (#465)
* refactor(logs): replace chalk by ansi-styles

* test(logs): fix the failing tests due to ansi styles

I was not able to disable or mock ansi-styles so instead I found a way to make the tests pass
it's not perfect but it's still nice because the logs will keep their trustful colour when running through the tests

* refactor(logs): simplify the syntax to colour the logs

* chore(rebase): update files due to rebase

* refactor(logger): reduce code duplication
2021-06-02 17:04:34 -04:00
Geoffrey Testelin
e884599072 docs(readme): add a brief summary for the default behaviour (#467)
@luketomlinson I think that we don't even need to change something in the default config due to the PR removing the skip comment options
2021-05-25 15:02:32 -04:00
Geoffrey Testelin
6ec637d238 feat(options): simplify config by removing skip stale message options (#457)
* feat(options): simplify config by removing skip stale message options

Closes #405
Closes #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
2021-05-25 14:14:22 -04:00
Geoffrey Testelin
16dfaa2c02 docs(overhaul): provide a very detailed documentation for the options (#456)
* docs: add doc for repo-token and fix a bunch of typo

* docs: add doc for days-before-stale

Closes #362

* docs: add doc for days-before-issue-stale

Closes #362

* docs: add doc for days-before-pr-stale

Closes #362

* docs: add doc for days-before-close options

Closes #362

* docs: add doc for stale-message options

Closes #362

* docs: add doc for close-message options

Closes #362

* docs: add doc for label options

Closes #362

* docs: add doc for exempt label options

Closes #362

* docs: add doc for only labels options

Closes #362

* docs: add doc for any of labels options

Closes #362

* docs: add doc for enable-statistics option

Closes #362

* docs: add doc for exempt milestones options

Closes #362

* docs: add doc for exempt all milestones options

Closes #362

* docs: add doc for assignees options

Closes #362

* docs: add doc for remove-stale-when-updated options

Closes #362

* docs: add doc for debug-only option

Closes #362

* docs: add doc for ascending option

Closes #362

* docs: add doc for skip-stale-message options

Closes #362

* docs: add doc for start-date option

Closes #362

* docs: add doc for delete-branch option

Closes #362

* docs: remove duplicated row

* docs: shorten the description in the array

* docs(readme): apply suggestion

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* docs(readme): apply suggestion

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* docs(readme): apply suggestion

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* docs(readme): apply suggestion

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* docs(readme): apply suggestion

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* docs(readme): apply suggestion

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* docs(readme): apply suggestion

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* docs(readme): apply suggestion

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* docs(readme): apply suggestion

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* chore(readme): enhance typo

* chore(readme): enhance typo

* chore(readme): enhance typo

* docs(readme): apply suggestion

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* chore(readme): enhance typo

* chore(readme): enhance typo

* chore(readme): enhance typo

* chore(readme): enhance typo

* docs(readme): add more information for days-before-stale option

* docs(readme): apply suggestion

* docs(readme): remove duplicated entry

nice catch @luketomlinson

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2021-05-25 13:25:52 -04:00
Geoffrey Testelin
4586dc972d chore(issue): add a feature request template when opening an issue (#454)
Closes #453
2021-05-24 10:38:06 -04:00
Geoffrey Testelin
98ed4cb500 chore(logs): final overhaul of the logs (#433)
* feat(logs): add a new log when an issue consumed at least one operation (#386)

* 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>

* docs(operations-per-run): improve the doc for this option

* feat(logs): add a new log when an issue consumed at least one operation

the log will be visible as the last row of the processing of the given issue
closes #348

* chore(readme): improve the operations per run

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* chore(readme): improve the operations per run

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* chore(readme): improve the operations per run

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* chore(readme): improve the operations per run

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* chore(readme): improve the operations per run

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* chore(readme): improve the operations per run

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Typo in how to perform check for specific labels (#357)

Not tests but feels like a typo.

Or if we keep the title it `exempt` feels more approriate:

          exempt-issue-labels: 'roadmap'
          exempt-pr-labels: 'roadmap'

* feat(any-of-labels): add 2 new options to customize for issues/PRs (#380)

* 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>

* feat(logs): enhance the logs for assignees and milestones (#382)

* 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(logs): enhance the logs for assignees and milestones

closes #381

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* style(typo): fix typo plural issue

* style(naming): rename two methods

* chore(error): remove a potential useless throw of error

* style(naming): rename one method

* refactor(issue): change the way to count the operations

* refactor(operations): create a method to reduce code duplication

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Romain Rigaux <romain.rigaux@gmail.com>

* chore(logs): final overhaul of the logs

display more values in cyan
display all the options the same way (with links pointing to the readme so that with anchors we could find them easily later
make them a little more humanized
add more logs especially for the stale conditions

* style(logs): fix typos

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Romain Rigaux <romain.rigaux@gmail.com>
2021-05-12 10:00:14 -04:00
Luke Tomlinson
523075947f Remove unused @octokit/reset and generate dist (#440) 2021-05-12 09:33:22 -04:00
dependabot[bot]
5a36bdc457 build(deps-dev): bump @types/semver from 7.3.4 to 7.3.5 (#444)
Bumps [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver) from 7.3.4 to 7.3.5.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 09:35:03 -04:00
dependabot[bot]
4a6aba205d build(deps): bump semver from 7.3.4 to 7.3.5 (#442)
Bumps [semver](https://github.com/npm/node-semver) from 7.3.4 to 7.3.5.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/master/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.3.4...v7.3.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 09:34:45 -04:00
dependabot[bot]
2a6d5d6990 build(deps-dev): bump typescript from 4.2.3 to 4.2.4 (#438)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.3 to 4.2.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.2.3...v4.2.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 09:17:03 -04:00
dependabot[bot]
ebd757c01b build(deps): bump hosted-git-info from 2.8.8 to 2.8.9 (#437)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 09:16:30 -04:00
dependabot[bot]
1ebe9f7454 build(deps): bump lodash from 4.17.19 to 4.17.21 (#436)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 09:15:41 -04:00
dependabot[bot]
a61d498059 build(deps-dev): bump @types/node from 14.14.31 to 15.0.2 (#431)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.31 to 15.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 16:47:44 -04:00
HonkingGoose
0a21a5ec79 chore: create bug/feature/PR template, configure template chooser (#397)
* chore: create bug/feature/PR template, configure template chooser

* use american grammar

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* use checklist

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* use bold text for context as well

* remove links from template chooser

* remove comment redirecting to hackerone

* rename bug -> problem, rewrite content

* remove steps to reproduce

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* problem -> issue

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* provide your -> your

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* improve help message to link issues

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* rename files, improve content

* add bug label to other_issue_report as well

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* remove nonsensical comment

* use h2 for headings

* give predefined config template

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>
2021-05-07 16:44:19 -04:00
dependabot[bot]
e7199f9c84 build(deps-dev): bump @typescript-eslint/parser from 4.16.1 to 4.22.1 (#430)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.16.1 to 4.22.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.22.1/packages/parser)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 16:40:29 -04:00
dependabot[bot]
e307118008 build(deps-dev): bump eslint-plugin-jest from 24.1.5 to 24.3.6 (#426)
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 24.1.5 to 24.3.6.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v24.1.5...v24.3.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 16:39:30 -04:00
dependabot[bot]
b53e7be65a build(deps): bump y18n from 4.0.0 to 4.0.1 (#410)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 16:38:39 -04:00
Shawn Smith
ff764c226b Typo fixes (#434) 2021-05-07 16:30:29 -04:00
Geoffrey Testelin
c11507e9b7 feat(logs): add a new log when an issue consumed at least one operation (#386)
* 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>

* docs(operations-per-run): improve the doc for this option

* feat(logs): add a new log when an issue consumed at least one operation

the log will be visible as the last row of the processing of the given issue
closes #348

* chore(readme): improve the operations per run

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* chore(readme): improve the operations per run

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* chore(readme): improve the operations per run

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* chore(readme): improve the operations per run

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* chore(readme): improve the operations per run

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* chore(readme): improve the operations per run

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Typo in how to perform check for specific labels (#357)

Not tests but feels like a typo.

Or if we keep the title it `exempt` feels more approriate:

          exempt-issue-labels: 'roadmap'
          exempt-pr-labels: 'roadmap'

* feat(any-of-labels): add 2 new options to customize for issues/PRs (#380)

* 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>

* feat(logs): enhance the logs for assignees and milestones (#382)

* 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(logs): enhance the logs for assignees and milestones

closes #381

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* style(typo): fix typo plural issue

* style(naming): rename two methods

* chore(error): remove a potential useless throw of error

* style(naming): rename one method

* refactor(issue): change the way to count the operations

* refactor(operations): create a method to reduce code duplication

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Romain Rigaux <romain.rigaux@gmail.com>
2021-05-03 09:20:07 -04:00
Geoffrey Testelin
440fb174b5 feat(remove-stale-when-updated): add 2 options for issues and prs (#383)
* 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>
2021-04-30 09:14:51 -04:00
Geoffrey Testelin
043fbbdea3 feat(logs): enhance the logs for assignees and milestones (#382)
* 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(logs): enhance the logs for assignees and milestones

closes #381

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-28 16:39:28 -04:00
Geoffrey Testelin
c70e174d4a feat(any-of-labels): add 2 new options to customize for issues/PRs (#380)
* 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>
2021-04-28 16:33:42 -04:00
Romain Rigaux
704929ea5a Typo in how to perform check for specific labels (#357)
Not tests but feels like a typo.

Or if we keep the title it `exempt` feels more approriate:

          exempt-issue-labels: 'roadmap'
          exempt-pr-labels: 'roadmap'
2021-04-28 16:27:23 -04:00
Geoffrey Testelin
5e20aa8410 feat(statistics): split the stats between issues and PRs (#364)
* 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>
2021-04-27 14:47:02 -04:00
Ross Brodbeck
10eec4583b Update codeql.yml 2021-04-23 15:34:48 -04:00
Geoffrey Testelin
b717aa9f47 chore(logs): enhance the logs (#358)
* 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>
2021-03-08 05:56:52 -05:00
dependabot[bot]
3b3c3f03cd build(deps-dev): bump typescript from 4.2.2 to 4.2.3 (#353)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-05 09:18:00 -05:00
dependabot[bot]
70f07a7b62 build(deps-dev): bump @typescript-eslint/parser from 4.15.2 to 4.16.1 (#344)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) 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/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.16.1/packages/parser)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-05 09:13:02 -05:00
dependabot[bot]
6a2a52084e build(deps): bump @octokit/rest from 18.3.2 to 18.3.3 (#354)
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.3.2 to 18.3.3.
- [Release notes](https://github.com/octokit/rest.js/releases)
- [Commits](https://github.com/octokit/rest.js/compare/v18.3.2...v18.3.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-05 09:12:55 -05:00
dependabot[bot]
bea117ba11 build(deps-dev): bump eslint-plugin-github from 4.1.1 to 4.1.2 (#356)
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.1.1...v4.1.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-05 09:12:45 -05:00
dependabot[bot]
c181784783 build(deps-dev): bump ts-jest from 26.5.2 to 26.5.3 (#355)
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 26.5.2 to 26.5.3.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v26.5.2...v26.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-05 09:12:38 -05:00
Geoffrey Testelin
93cc018477 test: add more coverage for the stale label behaviour (#352)
* 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 to make sure to understand how the stale label works

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-05 09:12:18 -05:00
dependabot[bot]
b80d40901f 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>
2021-03-04 06:38:50 -05:00
dependabot[bot]
10e1968c4f 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>
2021-03-04 06:38:32 -05:00
Geoffrey Testelin
ba1c02f61a 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
2021-03-04 06:38:05 -05:00
Geoffrey Testelin
419a53bc05 feat(statistics): display some stats in the logs (#337)
* 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
2021-03-01 15:34:35 -05:00
Jose Veiga
63ae8ac024 Feat: add any-of-labels option (#319)
* feat: add any-of-labels option

* chore: run pack script

* fix: error in milestones spec

* chore: update readme

* chore: fix default value in action.yml

* chore: add some unit tests

* docs: update README.md

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>

* refactor: add return type to lambda

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>
2021-03-01 11:05:53 -05:00
dependabot[bot]
8f5f223d0c Bump typescript from 4.1.5 to 4.2.2 (#340)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.5 to 4.2.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.1.5...v4.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 11:04:26 -05:00
dependabot[bot]
aac59820db Bump @typescript-eslint/eslint-plugin from 4.15.1 to 4.15.2 (#331)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.15.1 to 4.15.2.
- [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.15.2/packages/eslint-plugin)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 09:21:56 -05:00
dependabot[bot]
4109d00d07 Bump @types/node from 14.14.28 to 14.14.31 (#328)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.28 to 14.14.31.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 09:21:45 -05:00
dependabot[bot]
b3213c1ffa Bump eslint from 7.20.0 to 7.21.0 (#339)
Bumps [eslint](https://github.com/eslint/eslint) from 7.20.0 to 7.21.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.20.0...v7.21.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 09:21:33 -05:00
dependabot[bot]
12d218f917 Bump ts-jest from 26.5.1 to 26.5.2 (#332)
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 26.5.1 to 26.5.2.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v26.5.1...v26.5.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-28 19:11:57 -05:00
dependabot[bot]
e1732283c7 Bump @typescript-eslint/parser from 4.15.1 to 4.15.2 (#330)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.15.1 to 4.15.2.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.15.2/packages/parser)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-28 19:11:41 -05:00
dependabot[bot]
8439944051 Bump @octokit/rest from 18.1.1 to 18.3.0 (#338)
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.1.1 to 18.3.0.
- [Release notes](https://github.com/octokit/rest.js/releases)
- [Commits](https://github.com/octokit/rest.js/compare/v18.1.1...v18.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-28 19:11:32 -05:00
Geoffrey Testelin
0e95ddbecb feat(only-labels): add 2 new options to distinguish issue and PR configs (#336)
* 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
2021-02-28 19:08:33 -05:00
Geoffrey Testelin
836169b81a feat(close-label): automatically remove close-label when no longer closed nor locked (#334)
* 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
2021-02-28 19:07:54 -05:00
Geoffrey Testelin
ec96ff65b0 feat(assignees): add 6 new options to avoid stale for assignees (#327)
* 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
2021-02-28 06:15:08 -05:00
dependabot[bot]
996798eb71 Bump eslint-plugin-jest from 24.1.3 to 24.1.5 (#320)
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 24.1.3 to 24.1.5.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v24.1.3...v24.1.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-18 10:07:28 -05:00
dependabot[bot]
6a0398d581 Bump @typescript-eslint/parser from 4.14.0 to 4.15.1 (#317)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.14.0 to 4.15.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.15.1/packages/parser)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-16 06:28:21 -05:00
dependabot[bot]
7499904a44 Bump eslint from 7.19.0 to 7.20.0 (#318)
Bumps [eslint](https://github.com/eslint/eslint) from 7.19.0 to 7.20.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.19.0...v7.20.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-16 06:23:33 -05:00
dependabot[bot]
a8c9fbca3b Bump @typescript-eslint/eslint-plugin from 4.14.0 to 4.15.1 (#316)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.14.0 to 4.15.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.15.1/packages/eslint-plugin)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-16 06:23:21 -05:00
dependabot[bot]
8df2fb36e6 Bump @types/node from 14.14.26 to 14.14.28 (#315)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.26 to 14.14.28.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-16 06:23:08 -05:00
dependabot[bot]
d4d9b2a583 Bump ts-jest from 26.4.4 to 26.5.1 (#313)
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 26.4.4 to 26.5.1.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v26.4.4...v26.5.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-16 06:22:54 -05:00
dependabot[bot]
aee97aa05d Bump typescript from 4.1.3 to 4.1.5 (#312)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.3 to 4.1.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.1.3...v4.1.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-16 06:19:23 -05:00
dependabot[bot]
d6e4b48a0d Bump @octokit/rest from 18.0.12 to 18.1.1 (#311)
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.0.12 to 18.1.1.
- [Release notes](https://github.com/octokit/rest.js/releases)
- [Commits](https://github.com/octokit/rest.js/compare/v18.0.12...v18.1.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-16 06:19:11 -05:00
Geoffrey Testelin
6a493760cf feat(milestones): add new options to exempt all milestones (#291)
* 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
2021-02-16 06:18:48 -05:00
dependabot[bot]
07f3f88b6d Bump @types/node from 14.14.21 to 14.14.26 (#310)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.21 to 14.14.26.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-13 06:22:49 -05:00
dependabot[bot]
e2a65edb45 Bump @octokit/rest from 18.0.12 to 18.1.0 (#300)
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.0.12 to 18.1.0.
- [Release notes](https://github.com/octokit/rest.js/releases)
- [Commits](https://github.com/octokit/rest.js/compare/v18.0.12...v18.1.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-13 06:22:26 -05:00
dependabot[bot]
076138c5c7 Bump eslint from 7.18.0 to 7.19.0 (#296)
Bumps [eslint](https://github.com/eslint/eslint) from 7.18.0 to 7.19.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.18.0...v7.19.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-13 06:21:25 -05:00
Falk Puschner
bf7548e250 📝 add delete branch option (#309) 2021-02-13 06:10:02 -05:00
Geoffrey Testelin
e96f31f877 refactor: move and rename the interfaces/classes (#290)
closes #272
2021-02-13 06:09:37 -05:00
Ross Brodbeck
9d6f46564a Add rebuilt index 2021-02-05 06:56:22 -05:00
Michal Čihař
d21d307fd8 Log why issue is not marked as stale (#301)
This might help to understand some situations as described in https://github.com/actions/stale/issues/299.
2021-02-05 06:53:23 -05:00
Michal Čihař
7164109781 Fixed should be stale condition (#304)
* 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/224

Fixes #299

* Add tests for #299

Co-authored-by: Geoffrey Testelin <geoffrey.testelin@gmail.com>
2021-02-05 06:52:44 -05:00
Ross Brodbeck
079c368275 Add code owners for tracking 2021-02-04 12:23:06 -05:00
dependabot[bot]
86561461b9 Bump @typescript-eslint/eslint-plugin from 4.13.0 to 4.14.0 (#281)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.13.0 to 4.14.0.
- [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.14.0/packages/eslint-plugin)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-19 06:02:30 -05:00
dependabot[bot]
342b612d3c Bump @types/jest from 26.0.15 to 26.0.20 (#280)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.15 to 26.0.20.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-19 06:00:08 -05:00
dependabot[bot]
d09524cd2c Bump @typescript-eslint/parser from 4.13.0 to 4.14.0 (#282)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.13.0 to 4.14.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.14.0/packages/parser)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-19 05:59:51 -05:00
Geoffrey Testelin
f71123a6f7 feat(exempt): add new options to exempt the milestones (#279)
* 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
2021-01-19 05:54:16 -05:00
Ross Brodbeck
1b9f13b607 Add rebuilt package 2021-01-18 08:19:26 -05:00
dependabot[bot]
f8321eb62b Bump eslint from 7.17.0 to 7.18.0 (#274)
Bumps [eslint](https://github.com/eslint/eslint) from 7.17.0 to 7.18.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.17.0...v7.18.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 08:17:48 -05:00
dependabot[bot]
6a04021499 Bump @types/node from 14.10.0 to 14.14.21 (#276)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.10.0 to 14.14.21.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 08:17:37 -05:00
dependabot[bot]
7e83de7bef Bump js-yaml from 3.14.0 to 4.0.0 (#275)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.0 to 4.0.0.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.14.0...4.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 08:13:03 -05:00
dependabot[bot]
a9eccc216e Bump semver from 7.3.2 to 7.3.4 (#277)
Bumps [semver](https://github.com/npm/node-semver) from 7.3.2 to 7.3.4.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/master/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.3.2...v7.3.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 08:12:50 -05:00
dependabot[bot]
0fa41d1841 Bump @octokit/rest from 18.0.9 to 18.0.12 (#273)
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.0.9 to 18.0.12.
- [Release notes](https://github.com/octokit/rest.js/releases)
- [Commits](https://github.com/octokit/rest.js/compare/v18.0.9...v18.0.12)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-18 08:12:26 -05:00
Geoffrey Testelin
f698371c0d Add a start date option to ignore old issues and PRs (#269)
* 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
2021-01-17 20:22:36 -05:00
Geoffrey Testelin
7f340a46f3 Remove the stale label when labeled with an exempt one (#268)
* 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
2021-01-16 20:13:19 -05:00
Ross Brodbeck
3f95874437 Use main instead of v3 for more coverage 2021-01-16 09:50:58 -05:00
Geoffrey Testelin
e6b77bc964 feat(logs): enhance the logs and add a prefix with the issue number (#222)
* feat(logs): enhance the logs and add a prefix with the issue number

* chore: use camelCase for constants

use the new logger for the new code due to the rebase
2021-01-16 09:49:50 -05:00
Geoffrey Testelin
552e4c60f0 feat(stale-and-close): add new options to change the days before close (#224)
* 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
2021-01-16 08:28:29 -05:00
Ross Brodbeck
b12dccced8 Update package dependencies (#267) 2021-01-15 07:52:52 -05:00
Ross Brodbeck
7de5f1946d Update stale.yml 2021-01-15 07:40:06 -05:00
Ross Brodbeck
546a4e9fd6 Fix failing tests (#266) 2021-01-15 07:35:41 -05:00
Sora Morimoto
b5b956deb3 Remove an unnecessary step from codeql.yml (#254)
Signed-off-by: Sora Morimoto <sora@morimoto.io>
2021-01-15 07:21:49 -05:00
dependabot[bot]
6674e9130f Bump @vercel/ncc from 0.24.0 to 0.27.0 (#265)
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.24.0 to 0.27.0.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.24.0...0.27.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-15 07:20:54 -05:00
dependabot[bot]
73dbf86108 Bump typescript from 4.0.2 to 4.1.3 (#255)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.0.2 to 4.1.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-15 07:20:45 -05:00
Rylan Polster
a0b4b61711 Determine actor from PAT if possible (#231) 2021-01-15 07:20:32 -05:00
dependabot[bot]
0f78ebc7dc Bump eslint from 7.7.0 to 7.17.0 (#261)
Bumps [eslint](https://github.com/eslint/eslint) from 7.7.0 to 7.17.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.7.0...v7.17.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-15 07:14:24 -05:00
dependabot[bot]
b70b09d43a Bump prettier from 2.1.1 to 2.2.1 (#232)
Bumps [prettier](https://github.com/prettier/prettier) from 2.1.1 to 2.2.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.1.1...2.2.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-15 07:14:14 -05:00
dependabot[bot]
aca4d264ff Bump jest-circus from 26.4.2 to 26.6.3 (#229)
Bumps [jest-circus](https://github.com/facebook/jest/tree/HEAD/packages/jest-circus) from 26.4.2 to 26.6.3.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v26.6.3/packages/jest-circus)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-15 07:14:04 -05:00
Chad Whitacre
44c3cb508b Clarify significance of the exempt-* config knobs (#260)
This action doesn't apply exempt labels, it reads them.
2021-01-15 07:12:30 -05:00
Sora Morimoto
39de730f99 Provide the GitHub token by default (#253)
* Provide the GitHub token by default

Signed-off-by: Sora Morimoto <sora@morimoto.io>

* npm run build

Signed-off-by: Sora Morimoto <sora@morimoto.io>
2021-01-15 07:07:08 -05:00
Geoffrey Testelin
ddc7648635 fix(remove-label): do not encode the label to make sure to remove it (#220)
* 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
2021-01-15 06:51:24 -05:00
Alex Brazier
107018c400 feat: Add delete-branch option to delete PR branches after closing (#190)
* feat: Add `delete-branch` option to delete PR branches after closing

* Fix branch ref
2021-01-15 06:49:38 -05:00
143 changed files with 46931 additions and 10938 deletions

View File

@@ -1,3 +1,6 @@
dist/
lib/
node_modules/
# Ignore list
/*
# Do not ignore these folders:
!__tests__/
!src/

50
.eslintrc.js Normal file
View File

@@ -0,0 +1,50 @@
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:eslint-plugin-jest/recommended',
'eslint-config-prettier'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'eslint-plugin-jest'],
rules: {
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-ignore': 'allow-with-description'
}
],
'no-console': 'error',
'yoda': 'error',
'prefer-const': [
'error',
{
destructuring: 'all'
}
],
'no-control-regex': 'off',
'no-constant-condition': ['error', {checkLoops: false}]
},
overrides: [
{
files: ['**/*{test,spec}.ts'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'jest/no-standalone-expect': 'off',
'jest/no-conditional-expect': 'off',
'no-console': 'off',
}
}
],
env: {
node: true,
es6: true,
'jest/globals': true
}
};

View File

@@ -1,52 +0,0 @@
{
"plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error",
"camelcase": "off",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "off"
},
"env": {
"node": true,
"es6": true,
"jest/globals": true
}
}

1
.gitattributes vendored
View File

@@ -1 +1,2 @@
* text=auto eol=lf
.licenses/** -diff linguist-generated=true

35
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a bug report
title: ''
labels: bug, needs triage
assignees: ''
---
<!--- Please direct any generic questions related to actions to our support community forum at https://github.com/orgs/community/discussions --->
<!--- Before opening up a new bug report, please make sure to check for similar existing issues -->
**Description:**
A clear and concise description of what the bug is.
**Action version:**
Specify the action version
**Platform:**
- [ ] Ubuntu
- [ ] macOS
- [ ] Windows
**Runner type:**
- [ ] Hosted
- [ ] Self-hosted
**Repro steps:**
A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.
**Expected behavior:**
A description of what you expected to happen.
**Actual behavior:**
A description of what is actually happening.

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1 @@
blank_issues_enabled: false

View File

@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature request, needs triage
assignees: ''
---
<!--- Please direct any generic questions related to actions to our support community forum at https://github.com/orgs/community/discussions --->
<!--- Before opening up a new bug report, please make sure to check for similar existing issues -->
**Description:**
Describe your proposal.
**Justification:**
Justification or a use case for your proposal.
**Are you willing to submit a PR?**
<!--- We accept contributions! -->

View File

@@ -4,6 +4,11 @@ updates:
- package-ecosystem: 'npm'
# Look for `package.json` and `lock` files in the `root` directory
directory: '/'
# Check the npm registry for updates every day (weekdays)
# Check the npm registry for updates once a week (Monday)
schedule:
interval: 'daily'
interval: 'weekly'
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'

9
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,9 @@
**Description:**
Describe your changes.
**Related issue:**
Add link to the related issue.
**Check list:**
- [ ] Mark if documentation changes are required.
- [ ] Mark if tests were added or updated to cover the changes.

17
.github/workflows/basic-validation.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: Basic validation
on:
pull_request:
paths-ignore:
- '**.md'
push:
branches:
- main
- releases/*
paths-ignore:
- '**.md'
jobs:
call-basic-validation:
name: Basic validation
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main

17
.github/workflows/check-dist.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: Check dist/
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
jobs:
call-check-dist:
name: Check dist/
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main

14
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
name: 'Code scanning'
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 3 * * 0'
jobs:
call-codeQL-analysis:
name: CodeQL analysis
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main

View File

@@ -1,36 +0,0 @@
name: "Code scanning"
on:
push:
pull_request:
schedule:
- cron: '0 19 * * 0'
jobs:
CodeQL-Build:
# CodeQL runs on ubuntu-latest and windows-latest
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

26
.github/workflows/e2e-tests.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: e2e tests
on:
pull_request:
paths-ignore:
- '**.md'
push:
branches:
- main
- releases/*
paths-ignore:
- '**.md'
jobs:
dry-run-test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
id: stale
with:
stale-issue-message: 'This issue is stale'
stale-pr-message: 'This PR is stale'
debug-only: true
- name: Print outputs
run: echo ${{ format('{0},{1}', toJSON(steps.stale.outputs.staled-issues-prs), toJSON(steps.stale.outputs.closed-issues-prs)) }}

View File

@@ -1,20 +0,0 @@
name: Licensed
on:
push: {branches: main}
pull_request: {branches: main}
jobs:
test:
runs-on: ubuntu-latest
name: Check licenses
steps:
- uses: actions/checkout@v2
- run: npm ci
- name: Install licensed
run: |
cd $RUNNER_TEMP
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/2.12.2/licensed-2.12.2-linux-x64.tar.gz
sudo tar -xzf licensed.tar.gz
sudo mv licensed /usr/local/bin/licensed
- run: licensed status

15
.github/workflows/licensed.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: Licensed
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
call-licensed:
name: Licensed
uses: actions/reusable-workflows/.github/workflows/licensed.yml@main

View File

@@ -0,0 +1,28 @@
name: Release new action version
on:
release:
types: [released]
workflow_dispatch:
inputs:
TAG_NAME:
description: 'Tag name that the major tag will point to'
required: true
env:
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
permissions:
contents: write
jobs:
update_tag:
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
environment:
name: releaseNewActionVersion
runs-on: ubuntu-latest
steps:
- name: Update the ${{ env.TAG_NAME }} tag
uses: actions/publish-action@v0.2.2
with:
source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}

View File

@@ -1,16 +0,0 @@
name: "Stale issue handler"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days'
days-before-stale: 30
days-before-close: 5

View File

@@ -1,26 +0,0 @@
name: "Build"
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
- 'releases/*'
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
npm install
npm run all
test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale'
stale-pr-message: 'This PR is stale'
debug-only: true

View File

@@ -0,0 +1,11 @@
name: Update configuration files
on:
schedule:
- cron: '0 3 * * 0'
workflow_dispatch:
jobs:
call-update-configuration-files:
name: Update configuration files
uses: actions/reusable-workflows/.github/workflows/update-config-files.yml@main

View File

@@ -1,6 +1,6 @@
---
name: "@actions/core"
version: 1.2.4
version: 1.10.0
type: npm
summary: Actions core lib
homepage: https://github.com/actions/toolkit/tree/master/packages/core

View File

@@ -1,6 +1,6 @@
---
name: "@actions/github"
version: 4.0.0
version: 5.1.1
type: npm
summary: Actions github lib
homepage: https://github.com/actions/toolkit/tree/master/packages/github

View File

@@ -1,9 +1,9 @@
---
name: "@actions/http-client"
version: 1.0.8
version: 2.0.1
type: npm
summary: Actions Http Client
homepage: https://github.com/actions/http-client#readme
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
license: mit
licenses:
- sources: LICENSE

View File

@@ -1,9 +1,9 @@
---
name: "@octokit/auth-token"
version: 2.4.2
version: 2.5.0
type: npm
summary: GitHub API token authentication for browsers and Node.js
homepage: https://github.com/octokit/auth-token.js#readme
homepage:
license: mit
licenses:
- sources: LICENSE

View File

@@ -0,0 +1,34 @@
---
name: "@octokit/auth-token"
version: 3.0.3
type: npm
summary: GitHub API token authentication for browsers and Node.js
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License
Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
- sources: README.md
text: "[MIT](LICENSE)"
notices: []

View File

@@ -1,9 +1,9 @@
---
name: "@octokit/core"
version: 3.1.1
version: 3.6.0
type: npm
summary: Extendable client for GitHub's REST & GraphQL APIs
homepage: https://github.com/octokit/core.js#readme
homepage:
license: mit
licenses:
- sources: LICENSE

View File

@@ -0,0 +1,34 @@
---
name: "@octokit/core"
version: 4.2.0
type: npm
summary: Extendable client for GitHub's REST & GraphQL APIs
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License
Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
- sources: README.md
text: "[MIT](LICENSE)"
notices: []

View File

@@ -1,9 +1,9 @@
---
name: "@octokit/endpoint"
version: 6.0.5
version: 6.0.12
type: npm
summary: Turns REST API endpoints into generic request options
homepage: https://github.com/octokit/endpoint.js#readme
homepage:
license: mit
licenses:
- sources: LICENSE

View File

@@ -0,0 +1,34 @@
---
name: "@octokit/endpoint"
version: 7.0.5
type: npm
summary: Turns REST API endpoints into generic request options
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License
Copyright (c) 2018 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
- sources: README.md
text: "[MIT](LICENSE)"
notices: []

View File

@@ -1,9 +1,9 @@
---
name: "@octokit/graphql"
version: 4.5.2
version: 4.8.0
type: npm
summary: GitHub GraphQL API client for browsers and Node
homepage: https://github.com/octokit/graphql.js#readme
homepage:
license: mit
licenses:
- sources: LICENSE

View File

@@ -0,0 +1,34 @@
---
name: "@octokit/graphql"
version: 5.0.5
type: npm
summary: GitHub GraphQL API client for browsers and Node
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License
Copyright (c) 2018 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
- sources: README.md
text: "[MIT](LICENSE)"
notices: []

View File

@@ -1,18 +1,18 @@
---
name: "@octokit/plugin-request-log"
version: 1.0.0
name: "@octokit/openapi-types"
version: 12.11.0
type: npm
summary: Log all requests and request errors
homepage: https://github.com/octokit/plugin-request-log.js#readme
summary: Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License Copyright (c) 2020 Octokit contributors
text: |-
Copyright 2020 Gregor Martynus
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- sources: README.md

View File

@@ -0,0 +1,20 @@
---
name: "@octokit/openapi-types"
version: 16.0.0
type: npm
summary: Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com
homepage:
license: mit
licenses:
- sources: LICENSE
text: |-
Copyright 2020 Gregor Martynus
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- sources: README.md
text: "[MIT](LICENSE)"
notices: []

View File

@@ -1,9 +1,9 @@
---
name: "@octokit/plugin-paginate-rest"
version: 2.2.4
version: 2.21.3
type: npm
summary: Octokit plugin to paginate REST API endpoint responses
homepage: https://github.com/octokit/plugin-paginate-rest.js#readme
homepage:
license: mit
licenses:
- sources: LICENSE

View File

@@ -1,9 +1,9 @@
---
name: "@octokit/plugin-rest-endpoint-methods"
version: 4.1.2
version: 5.16.2
type: npm
summary: Octokit plugin adding one method for all of api.github.com REST API endpoints
homepage: https://github.com/octokit/plugin-rest-endpoint-methods.js#readme
homepage:
license: mit
licenses:
- sources: LICENSE

View File

@@ -0,0 +1,34 @@
---
name: "@octokit/plugin-retry"
version: 4.1.1
type: npm
summary: Automatic retry plugin for octokit
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) 2018 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- sources: README.md
text: "[MIT](LICENSE)"
notices: []

View File

@@ -1,10 +1,10 @@
---
name: "@octokit/request"
version: 5.4.7
version: 5.6.3
type: npm
summary: Send parameterized requests to GitHubs APIs with sensible defaults in browsers
summary: Send parameterized requests to GitHub's APIs with sensible defaults in browsers
and Node
homepage: https://github.com/octokit/request.js#readme
homepage:
license: mit
licenses:
- sources: LICENSE

View File

@@ -0,0 +1,35 @@
---
name: "@octokit/request"
version: 6.2.3
type: npm
summary: Send parameterized requests to GitHub's APIs with sensible defaults in browsers
and Node
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License
Copyright (c) 2018 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
- sources: README.md
text: "[MIT](LICENSE)"
notices: []

View File

@@ -1,9 +1,9 @@
---
name: "@octokit/request-error"
version: 2.0.2
version: 2.1.0
type: npm
summary: Error class for Octokit request errors
homepage: https://github.com/octokit/request-error.js#readme
homepage:
license: mit
licenses:
- sources: LICENSE

View File

@@ -0,0 +1,34 @@
---
name: "@octokit/request-error"
version: 3.0.3
type: npm
summary: Error class for Octokit request errors
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License
Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
- sources: README.md
text: "[MIT](LICENSE)"
notices: []

View File

@@ -1,35 +0,0 @@
---
name: "@octokit/rest"
version: 18.0.2
type: npm
summary: GitHub REST API client for Node.js
homepage: https://github.com/octokit/rest.js#readme
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License
Copyright (c) 2012 Cloud9 IDE, Inc. (Mike de Boer)
Copyright (c) 2017-2018 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
- sources: README.md
text: "[MIT](LICENSE)"
notices: []

View File

@@ -1,9 +1,9 @@
---
name: "@octokit/types"
version: 5.1.2
version: 6.41.0
type: npm
summary: Shared TypeScript definitions for Octokit projects
homepage: https://github.com/octokit/types.ts#readme
homepage:
license: mit
licenses:
- sources: LICENSE

View File

@@ -1,9 +1,9 @@
---
name: "@octokit/plugin-rest-endpoint-methods"
version: 4.1.1
name: "@octokit/types"
version: 9.0.0
type: npm
summary: Octokit plugin adding one method for all of api.github.com REST API endpoints
homepage: https://github.com/octokit/plugin-rest-endpoint-methods.js#readme
summary: Shared TypeScript definitions for Octokit projects
homepage:
license: mit
licenses:
- sources: LICENSE

View File

@@ -1,32 +0,0 @@
---
name: "@types/node"
version: 14.6.0
type: npm
summary: TypeScript definitions for Node.js
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped#readme
license: mit
licenses:
- sources: LICENSE
text: |2
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
notices: []

View File

@@ -1,9 +1,9 @@
---
name: before-after-hook
version: 2.1.0
version: 2.2.3
type: npm
summary: asynchronous before/error/after hooks for internal functionality
homepage: https://github.com/gr2m/before-after-hook#readme
homepage:
license: apache-2.0
licenses:
- sources: LICENSE

31
.licenses/npm/bottleneck.dep.yml generated Normal file
View File

@@ -0,0 +1,31 @@
---
name: bottleneck
version: 2.19.5
type: npm
summary: Distributed task scheduler and rate limiter
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2014 Simon Grondin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices: []

View File

@@ -1,6 +1,6 @@
---
name: is-plain-object
version: 4.1.1
version: 5.0.0
type: npm
summary: Returns true if an object was created by the `Object` constructor, or Object.create(null).
homepage: https://github.com/jonschlinkert/is-plain-object

58
.licenses/npm/lodash.deburr.dep.yml generated Normal file
View File

@@ -0,0 +1,58 @@
---
name: lodash.deburr
version: 4.1.0
type: npm
summary: The lodash method `_.deburr` exported as a module.
homepage: https://lodash.com/
license: mit
licenses:
- sources: LICENSE
text: |
Copyright jQuery Foundation and other contributors <https://jquery.org/>
Based on Underscore.js, copyright Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/lodash/lodash
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code displayed within the prose of the
documentation.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
Files located in the node_modules and vendor directories are externally
maintained libraries used by this software which have their own
licenses; we recommend you read them, as their terms may differ from the
terms above.
notices: []

26
.licenses/npm/lru-cache.dep.yml generated Normal file
View File

@@ -0,0 +1,26 @@
---
name: lru-cache
version: 6.0.0
type: npm
summary: A cache object that deletes the least-recently-used items.
homepage:
license: isc
licenses:
- sources: LICENSE
text: |
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
notices: []

View File

@@ -1,6 +1,6 @@
---
name: node-fetch
version: 2.6.0
version: 2.6.9
type: npm
summary: A light-weight module that brings window.fetch to node.js
homepage: https://github.com/bitinn/node-fetch
@@ -42,6 +42,10 @@ licenses:
[codecov-url]: https://codecov.io/gh/bitinn/node-fetch
[install-size-image]: https://flat.badgen.net/packagephobia/install/node-fetch
[install-size-url]: https://packagephobia.now.sh/result?p=node-fetch
[discord-image]: https://img.shields.io/discord/619915844268326952?color=%237289DA&label=Discord&style=flat-square
[discord-url]: https://discord.gg/Zxbndcm
[opencollective-image]: https://opencollective.com/node-fetch/backers.svg
[opencollective-url]: https://opencollective.com/node-fetch
[whatwg-fetch]: https://fetch.spec.whatwg.org/
[response-init]: https://fetch.spec.whatwg.org/#responseinit
[node-readable]: https://nodejs.org/api/stream.html#stream_readable_streams

View File

@@ -1,9 +1,9 @@
---
name: semver
version: 7.3.2
version: 7.3.8
type: npm
summary: The semantic version parser used by npm.
homepage: https://github.com/npm/node-semver#readme
homepage:
license: isc
licenses:
- sources: LICENSE

30
.licenses/npm/tr46.dep.yml generated Normal file
View File

@@ -0,0 +1,30 @@
---
name: tr46
version: 0.0.3
type: npm
summary: An implementation of the Unicode TR46 spec
homepage: https://github.com/Sebmaster/tr46.js#readme
license: mit
licenses:
- sources: Auto-generated MIT license text
text: |
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
notices: []

20
.licenses/npm/uuid.dep.yml generated Normal file
View File

@@ -0,0 +1,20 @@
---
name: uuid
version: 8.3.2
type: npm
summary: RFC4122 (v1, v4, and v5) UUIDs
homepage:
license: mit
licenses:
- sources: LICENSE.md
text: |
The MIT License (MIT)
Copyright (c) 2010-2020 Robert Kieffer and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices: []

23
.licenses/npm/webidl-conversions.dep.yml generated Normal file
View File

@@ -0,0 +1,23 @@
---
name: webidl-conversions
version: 3.0.1
type: npm
summary: Implements the WebIDL algorithms for converting to and from JavaScript values
homepage:
license: bsd-2-clause
licenses:
- sources: LICENSE.md
text: |
# The BSD 2-Clause License
Copyright (c) 2014, Domenic Denicola
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
notices: []

32
.licenses/npm/whatwg-url.dep.yml generated Normal file
View File

@@ -0,0 +1,32 @@
---
name: whatwg-url
version: 5.0.0
type: npm
summary: An implementation of the WHATWG URL Standard's URL API and parsing machinery
homepage:
license: mit
licenses:
- sources: LICENSE.txt
text: |
The MIT License (MIT)
Copyright (c) 20152016 Sebastian Mayr
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
notices: []

26
.licenses/npm/yallist.dep.yml generated Normal file
View File

@@ -0,0 +1,26 @@
---
name: yallist
version: 4.0.0
type: npm
summary: Yet Another Linked List
homepage:
license: isc
licenses:
- sources: LICENSE
text: |
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
notices: []

7
.prettierignore Normal file
View File

@@ -0,0 +1,7 @@
# Ignore list
/*
# Do not ignore these folders:
!__tests__/
!.github/
!src/

11
.prettierrc.js Normal file
View File

@@ -0,0 +1,11 @@
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
module.exports = {
printWidth: 80,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
trailingComma: 'none',
bracketSpacing: false,
arrowParens: 'avoid'
};

View File

@@ -1,11 +0,0 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"parser": "typescript"
}

3
.versionrc.json Normal file
View File

@@ -0,0 +1,3 @@
{
"header": "### Actions Stale Changelog\n"
}

2
.vscode/launch.json vendored
View File

@@ -9,7 +9,7 @@
"args": [
"-i"
],
"preLaunchTask": "tsc: build - tsconfig.json",
"preLaunchTask": "tsc: build - tsconfig.app.json",
"internalConsoleOptions": "openOnSessionStart",
"console": "integratedTerminal",
"outFiles": [

53
CHANGELOG.md Normal file
View File

@@ -0,0 +1,53 @@
# Changelog
# [7.0.0]
:warning: Breaking change :warning:
* Allow daysBeforeStale options to be float by @irega in https://github.com/actions/stale/pull/841
* Use cache in check-dist.yml by @jongwooo in https://github.com/actions/stale/pull/876
* fix print outputs step in existing workflows by @irega in https://github.com/actions/stale/pull/859
* Update issue and PR templates, add/delete workflow files by @IvanZosimov in https://github.com/actions/stale/pull/880
* Update how stale handles exempt items by @johnsudol in https://github.com/actions/stale/pull/874
# [6.0.1]
Update @actions/core to v1.10.0 ([#839](https://github.com/actions/stale/pull/839))
# [6.0.0]
:warning: Breaking change :warning:
Issues/PRs default `close-issue-reason` is now `not_planned`([#789](https://github.com/actions/stale/issues/789))
# [5.1.0]
[Don't process stale issues right after they're marked stale](https://github.com/actions/stale/issues/696)
[Add close-issue-reason option][#764](https://github.com/actions/stale/pull/764)[#772](https://github.com/actions/stale/pull/772)
Various dependabot/dependency updates
## [4.1.0](https://github.com/actions/stale/compare/v3.0.19...v4.1.0) (2021-07-14)
## Features
- [Ability to exempt draft PRs](https://github.com/actions/stale/commit/9912fa74d1c01b5d6187793d97441019cbe325d0)
## [4.0.0](https://github.com/actions/stale/compare/v3.0.19...v4.0.0) (2021-07-14)
### Features
- **options:** simplify config by removing skip stale message options ([#457](https://github.com/actions/stale/issues/457)) ([6ec637d](https://github.com/actions/stale/commit/6ec637d238067ab8cc96c9289dcdac280bbd3f4a)), closes [#405](https://github.com/actions/stale/issues/405) [#455](https://github.com/actions/stale/issues/455)
- **output:** print output parameters ([#458](https://github.com/actions/stale/issues/458)) ([3e6d35b](https://github.com/actions/stale/commit/3e6d35b685f0b2fa1a69be893fa07d3d85e05ee0))
### Bug Fixes
- **dry-run:** forbid mutations in dry-run ([#500](https://github.com/actions/stale/issues/500)) ([f1017f3](https://github.com/actions/stale/commit/f1017f33dd159ea51366375120c3e6981d7c3097)), closes [#499](https://github.com/actions/stale/issues/499)
- **logs:** coloured logs ([#465](https://github.com/actions/stale/issues/465)) ([5fbbfba](https://github.com/actions/stale/commit/5fbbfba142860ea6512549e96e36e3540c314132))
- **operations:** fail fast the current batch to respect the operations limit ([#474](https://github.com/actions/stale/issues/474)) ([5f6f311](https://github.com/actions/stale/commit/5f6f311ca6aa75babadfc7bac6edf5d85fa3f35d)), closes [#466](https://github.com/actions/stale/issues/466)
- **label comparison**: make label comparison case insensitive [#517](https://github.com/actions/stale/pull/517), closes [#516](https://github.com/actions/stale/pull/516)
- **filtering comments by actor could have strange behavior**: "stale" comments are now detected based on if the message is the stale message not _who_ made the comment([#519](https://github.com/actions/stale/pull/519)), fixes [#441](https://github.com/actions/stale/pull/441), [#509](https://github.com/actions/stale/pull/509), [#518](https://github.com/actions/stale/pull/518)
### Breaking Changes
- The options `skip-stale-issue-message` and `skip-stale-pr-message` were removed. Instead, setting the options `stale-issue-message` and `stale-pr-message` will be enough to let the stale workflow add a comment. If the options are unset, a comment will not be added which was the equivalent of setting `skip-stale-issue-message` to `true`.
- The `operations-per-run` option will be more effective. After migrating, you could face a failed-fast process workflow if you let the default value (30) or set it to a small number. In that case, you will see a warning at the end of the logs (if enabled) indicating that the workflow was stopped sooner to avoid consuming too much API calls. In most cases, you can just increase this limit to make sure to process everything in a single run.

1
CODEOWNERS Normal file
View File

@@ -0,0 +1 @@
* @actions/setup-actions-team

74
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,74 @@
# Building and testing
Install the dependencies.
```bash
$ npm install
```
Build the typescript and package it for distribution.
```bash
$ npm run build && npm run pack
```
Run the tests :heavy_check_mark:
```bash
$ npm test
```
Run the tests and display only the first failing tests :heavy_check_mark:
```bash
$ npm run test:only-errors
```
Run the tests with the watch mode :heavy_check_mark:
```bash
$ npm run test:watch
```
Run the linter and fix (almost) every issue for you :heavy_check_mark:
```bash
$ npm run lint:all:fix
```
# Before creating a PR
## Build and quality checks
Build, lint, package and test everything.
```bash
$ npm run all
```
IMPORTANT:
Be sure to commit the result of:
```bash
$ npm run pack
```
Otherwise PR checks will fail.
# Release
Based on [standard-version](https://github.com/conventional-changelog/standard-version).
## Define the new version
You can run `npm run release:dry-run` to create a dry-run, or you can directly run `npm run release` to create a new local release.
It will run `prerelease` beforehand to build and pack everything.
If the `prerelease` succeeded, a bump of version will happen based on the unreleased commits.
It will:
- Update the _package.json_ version field
- Update the _package-lock.json_ version field
- Update the _CHANGELOG.md_ to include the release notes of the new version
- Create a local tag
- Create a commit
If everything generated seems ok for you, you can push your tag by running `git push --follow-tags origin {your-branch-name}`.

770
README.md
View File

@@ -1,104 +1,643 @@
# Close Stale Issues and PRs
[![Basic validation](https://github.com/actions/stale/actions/workflows/basic-validation.yml/badge.svg?branch=main)](https://github.com/actions/stale/actions/workflows/basic-validation.yml)
[![e2e tests](https://github.com/actions/stale/actions/workflows/e2e-tests.yml/badge.svg?branch=main)](https://github.com/actions/stale/actions/workflows/e2e-tests.yml)
Warns and then closes issues and PRs that have had no activity for a specified amount of time.
### Building and testing
The configuration must be on the default branch and the default values will:
Install the dependencies
```bash
$ npm install
- Add a label "Stale" on issues and pull requests after 60 days of inactivity and comment on them
- Close the stale issues and pull requests after 7 days of inactivity
- If an update/comment occur on stale issues or pull requests, the stale label will be removed and the timer will restart
## Recommended permissions
For the execution of this action, it must be able to fetch all issues and pull requests from your repository.
In addition, based on the provided configuration, the action could require more permission(s) (e.g.: add label, remove label, comment, close, delete branch, etc.).
This can be achieved with the following [configuration in the action](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions) if the permissions are restricted:
```yaml
permissions:
contents: write # only for delete-branch option
issues: write
pull-requests: write
```
Build the typescript and package it for distribution
```bash
$ npm run build && npm run pack
```
You can find more information about the required permissions under the corresponding options that you wish to use.
Run the tests :heavy_check_mark:
```bash
$ npm test
```
### Arguments
## All options
| Input | Description | Usage |
| :---: | :---: | :---: |
| `repo-token` | PAT(Personal Access Token) for authorizing repository. | *Required* |
| `days-before-stale` | Idle number of days before marking an issue/pr as stale. *Defaults to **60*** | Optional
| `days-before-close` | Idle number of days before closing an stale issue/pr. *Defaults to **7*** | Optional
| `stale-issue-message` | Message to post on the stale issue. | Optional
| `stale-pr-message` | Message to post on the stale pr. | Optional
| `close-issue-message` | Message to post on the stale issue while closing it. | Optional
| `close-pr-message` | Message to post on the stale pr while closing it. | Optional
| `stale-issue-label` | Label to apply on the stale issue. *Defaults to **stale*** | Optional
| `close-issue-label` | Label to apply on closing issue. | Optional
| `stale-pr-label` | Label to apply on the stale pr. | Optional
| `close-pr-label` | Label to apply on the closing pr. | Optional
| `exempt-issue-labels` | Labels on an issue exempted from being marked as stale. | Optional
| `exempt-pr-labels` | Labels on the pr exempted from being marked as stale. | Optional
| `only-labels` | Only labels checked for stale issue/pr. | Optional
| `operations-per-run` | Maximum number of operations per run. *Defaults to **30*** | Optional
| `remove-stale-when-updated` | Remove stale label from issue/pr on updates or comments. *Defaults to **true*** | Optional
| `debug-only` | Dry-run on action. *Defaults to **false*** | Optional
| `ascending` | Order to get issues/pr. *Defaults to **false*** | Optional
| `skip-stale-issue-message` | Skip adding stale message on stale issue. *Defaults to **false*** | Optional
| `skip-stale-pr-message` | Skip adding stale message on stale pr. *Defaults to **false*** | Optional
### List of input options
Every argument is optional.
| Input | Description | Default |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------- |
| [repo-token](#repo-token) | PAT for GitHub API authentication | `${{ github.token }}` |
| [days-before-stale](#days-before-stale) | Idle number of days before marking issues/PRs stale | `60` |
| [days-before-issue-stale](#days-before-issue-stale) | Override [days-before-stale](#days-before-stale) for issues only | |
| [days-before-pr-stale](#days-before-pr-stale) | Override [days-before-stale](#days-before-stale) for PRs only | |
| [days-before-close](#days-before-close) | Idle number of days before closing stale issues/PRs | `7` |
| [days-before-issue-close](#days-before-issue-close) | Override [days-before-close](#days-before-close) for issues only | |
| [days-before-pr-close](#days-before-pr-close) | Override [days-before-close](#days-before-close) for PRs only | |
| [stale-issue-message](#stale-issue-message) | Comment on the staled issues | |
| [stale-pr-message](#stale-pr-message) | Comment on the staled PRs | |
| [close-issue-message](#close-issue-message) | Comment on the staled issues while closed | |
| [close-pr-message](#close-pr-message) | Comment on the staled PRs while closed | |
| [stale-issue-label](#stale-issue-label) | Label to apply on staled issues | `Stale` |
| [close-issue-label](#close-issue-label) | Label to apply on closed issues | |
| [close-issue-reason](#close-issue-reason) | Reason to use when closing issues | `not_planned` |
| [stale-pr-label](#stale-pr-label) | Label to apply on staled PRs | `Stale` |
| [close-pr-label](#close-pr-label) | Label to apply on closed PRs | |
| [exempt-issue-labels](#exempt-issue-labels) | Labels on issues exempted from stale | |
| [exempt-pr-labels](#exempt-pr-labels) | Labels on PRs exempted from stale | |
| [only-labels](#only-labels) | Only issues/PRs with ALL these labels are checked | |
| [only-issue-labels](#only-issue-labels) | Override [only-labels](#only-labels) for issues only | |
| [only-pr-labels](#only-pr-labels) | Override [only-labels](#only-labels) for PRs only | |
| [any-of-labels](#any-of-labels) | Only issues/PRs with ANY of these labels are checked | |
| [any-of-issue-labels](#any-of-issue-labels) | Override [any-of-labels](#any-of-labels) for issues only | |
| [any-of-pr-labels](#any-of-pr-labels) | Override [any-of-labels](#any-of-labels) for PRs only | |
| [operations-per-run](#operations-per-run) | Max number of operations per run | `30` |
| [remove-stale-when-updated](#remove-stale-when-updated) | Remove stale label from issues/PRs on updates | `true` |
| [remove-issue-stale-when-updated](#remove-issue-stale-when-updated) | Remove stale label from issues on updates/comments | |
| [remove-pr-stale-when-updated](#remove-pr-stale-when-updated) | Remove stale label from PRs on updates/comments | |
| [labels-to-add-when-unstale](#labels-to-add-when-unstale) | Add specified labels from issues/PRs when they become unstale | |
| [labels-to-remove-when-stale](#labels-to-remove-when-stale) | Remove specified labels from issues/PRs when they become stale | |
| [labels-to-remove-when-unstale](#labels-to-remove-when-unstale) | Remove specified labels from issues/PRs when they become unstale | |
| [debug-only](#debug-only) | Dry-run | `false` |
| [ascending](#ascending) | Order to get issues/PRs | `false` |
| [start-date](#start-date) | Skip stale action for issues/PRs created before it | |
| [delete-branch](#delete-branch) | Delete branch after closing a stale PR | `false` |
| [exempt-milestones](#exempt-milestones) | Milestones on issues/PRs exempted from stale | |
| [exempt-issue-milestones](#exempt-issue-milestones) | Override [exempt-milestones](#exempt-milestones) for issues only | |
| [exempt-pr-milestones](#exempt-pr-milestones) | Override [exempt-milestones](#exempt-milestones) for PRs only | |
| [exempt-all-milestones](#exempt-all-milestones) | Exempt all issues/PRs with milestones from stale | `false` |
| [exempt-all-issue-milestones](#exempt-all-issue-milestones) | Override [exempt-all-milestones](#exempt-all-milestones) for issues only | |
| [exempt-all-pr-milestones](#exempt-all-pr-milestones) | Override [exempt-all-milestones](#exempt-all-milestones) for PRs only | |
| [exempt-assignees](#exempt-assignees) | Assignees on issues/PRs exempted from stale | |
| [exempt-issue-assignees](#exempt-issue-assignees) | Override [exempt-assignees](#exempt-assignees) for issues only | |
| [exempt-pr-assignees](#exempt-pr-assignees) | Override [exempt-assignees](#exempt-assignees) for PRs only | |
| [exempt-all-assignees](#exempt-all-assignees) | Exempt all issues/PRs with assignees from stale | `false` |
| [exempt-all-issue-assignees](#exempt-all-issue-assignees) | Override [exempt-all-assignees](#exempt-all-assignees) for issues only | |
| [exempt-all-pr-assignees](#exempt-all-pr-assignees) | Override [exempt-all-assignees](#exempt-all-assignees) for PRs only | |
| [exempt-draft-pr](#exempt-draft-pr) | Skip the stale action for draft PRs | `false` |
| [enable-statistics](#enable-statistics) | Display statistics in the logs | `true` |
| [ignore-updates](#ignore-updates) | Any update (update/comment) can reset the stale idle time on the issues/PRs | `false` |
| [ignore-issue-updates](#ignore-issue-updates) | Override [ignore-updates](#ignore-updates) for issues only | |
| [ignore-pr-updates](#ignore-pr-updates) | Override [ignore-updates](#ignore-updates) for PRs only | |
| [include-only-assigned](#include-only-assigned) | Process only assigned issues | `false` |
### List of output options
| Output | Description |
| ----------------- | ------------------------------------------- |
| staled-issues-prs | List of all staled issues and pull requests |
| closed-issues-prs | List of all closed issues and pull requests |
### Detailed options
#### repo-token
Personal Access Token (PAT) that allows the stale workflow to authenticate and perform API calls to GitHub.
Under the hood, it uses the [@actions/github](https://www.npmjs.com/package/@actions/github) package.
Default value: `${{ github.token }}`
#### days-before-stale
The idle number of days before marking the issues or the pull requests as stale (by adding a label).
The issues or the pull requests will be marked as stale if the last update (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) is older than the idle number of days.
It means that any updates made, or any comments added to the issues or to the pull requests will restart the counter of days before marking as stale.
However, if you wish to ignore this behaviour so that the creation date (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `created_at`) only matters, you can disable the [ignore-updates](#ignore-updates) option.
If set to a negative number like `-1`, no issues or pull requests will be marked as stale automatically.
In that case, you can still add the stale label manually to mark as stale.
The label used to stale is defined by these two options:
- [stale-issue-label](#stale-issue-label)
- [stale-pr-label](#stale-pr-label)
A comment can also be added to notify about the stale and is defined by these two options:
- [stale-issue-message](#stale-issue-message)
- [stale-pr-message](#stale-pr-message)
You can fine tune which issues or pull requests should be marked as stale based on the milestones, the assignees, the creation date and the missing/present labels from these options:
- [exempt-issue-labels](#exempt-issue-labels)
- [exempt-pr-labels](#exempt-pr-labels)
- [only-labels](#only-labels)
- [any-of-labels](#any-of-labels)
- [start-date](#start-date)
- [exempt-milestones](#exempt-milestones)
- [exempt-all-milestones](#exempt-all-milestones)
- [exempt-assignees](#exempt-assignees)
- [exempt-all-assignees](#exempt-all-assignees)
- [ignore-updates](#ignore-updates)
Default value: `60`
#### days-before-issue-stale
Useful to override [days-before-stale](#days-before-stale) but only for the idle number of days before marking the issues as stale.
Default value: unset
#### days-before-pr-stale
Useful to override [days-before-stale](#days-before-stale) but only for the idle number of days before marking the pull requests as stale.
Default value: unset
#### days-before-close
The idle number of days before closing the stale issues or the stale pull requests (due to the stale label).
The issues or the pull requests will be closed if the last update (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) is older than the idle number of days.
Since adding the stale label will alter the last update date, we can calculate the number of days from this date.
If set to a negative number like `-1`, the issues or the pull requests will never be closed automatically.
The label used to stale is defined by these two options:
- [stale-issue-label](#stale-issue-label)
- [stale-pr-label](#stale-pr-label)
Default value: `7`
#### days-before-issue-close
Override [days-before-close](#days-before-close) but only for the idle number of days before closing the stale issues.
Default value: unset
#### days-before-pr-close
Override [days-before-close](#days-before-close) but only for the idle number of days before closing the stale pull requests.
Default value: unset
#### stale-issue-message
The message that will be added as a comment to the issues when the stale workflow marks it automatically as stale with a label.
You can skip the comment sending by passing an empty string.
Default value: unset
Required Permission: `issues: write`
#### stale-pr-message
The message that will be added as a comment to the pull requests when the stale workflow marks it automatically as stale with a label.
You can skip the comment sending by passing an empty string.
Default value: unset
Required Permission: `pull-requests: write`
#### close-issue-message
The message that will be added as a comment to the issues when the stale workflow closes it automatically after being stale for too long.
Default value: unset
Required Permission: `issues: write`
#### close-pr-message
The message that will be added as a comment to the pull requests when the stale workflow closes it automatically after being stale for too long.
Default value: unset
Required Permission: `pull-requests: write`
#### stale-issue-label
The label that will be added to the issues when automatically marked as stale.
If you wish to speedup the stale workflow for the issues, you can add this label manually to mark as stale.
Default value: `Stale`
Required Permission: `issues: write`
#### close-issue-label
The label that will be added to the issues when closed automatically.
It will be automatically removed if the issues are no longer closed nor locked.
Default value: unset
Required Permission: `issues: write`
#### close-issue-reason
Specify the [reason](https://github.blog/changelog/2022-05-19-the-new-github-issues-may-19th-update/) used when closing issues. Valid values are `completed` and `not_planned`.
Default value: `not_planned`
#### stale-pr-label
The label that will be added to the pull requests when automatically marked as stale.
If you wish to speedup the stale workflow for the pull requests, you can add this label manually to mark as stale.
Default value: `Stale`
Required Permission: `pull-requests: write`
#### close-pr-label
The label that will be added to the pull requests when closed automatically.
It will be automatically removed if the pull requests are no longer closed nor locked.
Default value: unset
Required Permission: `pull-requests: write`
#### exempt-issue-labels
Comma separated list of labels that can be assigned to issues to exclude them from being marked as stale
(e.g: `question,bug`)
If unset (or an empty string), this option will not alter the stale workflow.
Default value: unset
#### exempt-pr-labels
Comma separated list of labels that can be assigned to pull requests to exclude them from being marked as stale
(e.g: `need-help,WIP`)
If unset (or an empty string), this option will not alter the stale workflow.
Default value: unset
#### only-labels
An allow-list of label(s) to only process the issues or the pull requests that contain all these label(s).
It can be a comma separated list of labels (e.g: `answered,needs-rebase`).
If unset (or an empty string), this option will not alter the stale workflow.
If you wish to only check that the issues or the pull requests contain one of these label(s), use instead [any-of-labels](#any-of-labels).
Default value: unset
#### only-issue-labels
Override [only-labels](#only-labels) but only to process the issues that contain all these label(s).
Default value: unset
#### only-pr-labels
Override [only-labels](#only-labels) but only to process the pull requests that contain all these label(s).
Default value: unset
#### any-of-labels
An allow-list of label(s) to only process the issues or the pull requests that contain one of these label(s).
It can be a comma separated list of labels (e.g: `answered,needs-rebase`).
If unset (or an empty string), this option will not alter the stale workflow.
If you wish to only check that the issues or the pull requests contain all these label(s), use instead [only-labels](#only-labels).
Default value: unset
#### any-of-issue-labels
Override [any-of-labels](#any-of-labels) but only to process the issues that contain one of these label(s).
Default value: unset
#### any-of-pr-labels
Override [any-of-labels](#any-of-labels) but only to process the pull requests that contain one of these label(s).
Default value: unset
#### operations-per-run
_Context:_
This action performs some API calls to GitHub to fetch or close issues and pull requests, set or update labels, add comments, delete branches, etc.
These operations are made in a very short period of time — because the action is very fast to run — and can be numerous based on your project action configuration and the quantity of issues and pull requests within it.
GitHub has a [rate limit](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting) and if reached will block these API calls for one hour (or API calls from other actions using the same user (a.k.a.: the github-token from the [repo-token](#repo-token) option)).
This option helps you to stay within the GitHub rate limits, as you can use this option to limit the number of operations for a single run.
_Purpose:_
This option aims to limit the number of operations made with the GitHub API to avoid reaching the [rate limit](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting).
Based on your project, your GitHub business plan and the date of the cron job you set for this action, you can increase this limit to a higher number.
If you are not sure which is the right value for you or if the default value is good enough, you could enable the logs and look at the end of the stale action.
If you reached the limit, you will see a warning message in the logs, telling you that you should increase the number of operations.
If you choose not to increase the limit, you might end up with unprocessed issues or pull requests after a stale action run.
When [debugging](#Debugging), you can set it to a much higher number like `1000` since there will be fewer operations made with the GitHub API.
Only the [actor](#repo-token) and the batch of issues (100 per batch) will consume the operations.
Default value: `30`
#### remove-stale-when-updated
Automatically remove the stale label when the issues or the pull requests are updated (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) or commented.
Default value: `true`
Required Permission: `issues: write` and `pull-requests: write`
#### remove-issue-stale-when-updated
Override [remove-stale-when-updated](#remove-stale-when-updated) but only to automatically remove the stale label when the issues are updated (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) or commented.
Default value: unset
Required Permission: `issues: write`
#### remove-pr-stale-when-updated
Override [remove-stale-when-updated](#remove-stale-when-updated) but only to automatically remove the stale label when the pull requests are updated (based on [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`) or commented.
Default value: unset
#### labels-to-add-when-unstale
A comma delimited list of labels to add when a stale issue or pull request receives activity and has the [stale-issue-label](#stale-issue-label) or [stale-pr-label](#stale-pr-label) removed from it.
Default value: unset
#### labels-to-remove-when-stale
A comma delimited list of labels to remove when an issue or pull request becomes stale and has the [stale-issue-label](#stale-issue-label) or [stale-pr-label](#stale-pr-label) added to it.
Warning: each label results in a unique API call which can drastically consume the limit of [operations-per-run](#operations-per-run).
Default value: unset
Required Permission: `pull-requests: write`
#### labels-to-remove-when-unstale
A comma delimited list of labels to remove when a stale issue or pull request receives activity and has the [stale-issue-label](#stale-issue-label) or [stale-pr-label](#stale-pr-label) removed from it.
Warning: each label results in a unique API call which can drastically consume the limit of [operations-per-run](#operations-per-run).
Default value: unset
Required Permission: `pull-requests: write`
#### debug-only
Run the stale workflow as dry-run.
No GitHub API calls that can alter your issues and pull requests will happen.
Useful to debug or when you want to configure the stale workflow safely.
Default value: `false`
#### ascending
Change the order used to fetch the issues and pull requests from GitHub:
- `true` is for ascending.
- `false` is for descending.
It can be useful if your repository is processing so many issues and pull requests that you reach the [operations-per-run](#operations-per-run) limit.
Based on the order, you could prefer to focus on the new content or on the old content of your repository.
Default value: `false`
#### start-date
The start date is used to ignore the issues and pull requests created before the start date.
Particularly useful when you wish to add this stale workflow on an existing repository and only wish to stale the new issues and pull requests.
If set, the date must be formatted following the `ISO 8601` or `RFC 2822` standard.
Default value: unset
#### delete-branch
If set to `true`, the stale workflow will automatically delete the GitHub branches related to the pull requests automatically closed by the stale workflow.
Default value: `false`
Required Permission: `pull-requests: write` and `contents: write`
#### exempt-milestones
A white-list of milestone(s) to only process the issues or the pull requests that does not contain one of these milestone(s).
It can be a comma separated list of milestones (e.g: `V1,next`).
If unset (or an empty string), this option will not alter the stale workflow.
Default value: unset
#### exempt-issue-milestones
Override [exempt-milestones](#exempt-milestones) but only to process the issues that does not contain one of these milestone(s).
Default value: unset
#### exempt-pr-milestones
Override [exempt-milestones](#exempt-milestones) but only to process the pull requests that does not contain one of these milestone(s).
Default value: unset
#### exempt-all-milestones
If set to `true`, the issues or the pull requests with a milestone will not be marked as stale automatically.
Priority over [exempt-milestones](#exempt-milestones).
Default value: `false`
#### exempt-all-issue-milestones
Override [exempt-all-milestones](#exempt-all-milestones) but only to exempt the issues with a milestone to be marked as stale automatically.
Default value: unset
#### exempt-all-pr-milestones
Override [exempt-all-milestones](#exempt-all-milestones) but only to exempt the pull requests with a milestone to be marked as stale automatically.
Default value: unset
#### exempt-assignees
An allow-list of assignee(s) to only process the issues or the pull requests that does not contain one of these assignee(s).
It can be a comma separated list of assignees (e.g: `marco,polo`).
If unset (or an empty string), this option will not alter the stale workflow.
Default value: unset
#### exempt-issue-assignees
Override [exempt-assignees](#exempt-assignees) but only to process the issues that does not contain one of these assignee(s).
Default value: unset
#### exempt-pr-assignees
Override [exempt-assignees](#exempt-assignees) but only to process the pull requests that does not contain one of these assignee(s).
Default value: unset
#### exempt-all-assignees
If set to `true`, the issues or the pull requests with an assignee will not be marked as stale automatically.
Priority over [exempt-assignees](#exempt-assignees).
Default value: `false`
#### exempt-all-issue-assignees
Override [exempt-all-assignees](#exempt-all-assignees) but only to exempt the issues with an assignee to be marked as stale automatically.
Default value: unset
#### exempt-all-pr-assignees
Override [exempt-all-assignees](#exempt-all-assignees) but only to exempt the pull requests with an assignee to be marked as stale automatically.
Default value: unset
#### exempt-draft-pr
If set to `true`, the pull requests currently in draft will not be marked as stale automatically.
⚠️ This option consume one operation per pull request to process because we need to fetch the pull request with the GitHub API to know if it's a draft one or not.
Default value: `false`
Required Permission: `pull-requests: read`
#### enable-statistics
Collects and display statistics at the end of the stale workflow logs to get a summary of what happened during the run.
This option is only useful if the debug output secret `ACTIONS_STEP_DEBUG` is set to `true` in your repository to display the logs.
Default value: `true`
#### ignore-updates
The option [days-before-stale](#days-before-stale) will define the number of days before considering the issues or the pull requests as stale.
In most cases, the purpose of this action is to only stale when necessary so if any update occurs or if a comment is added to them, the counter will restart.
Nonetheless, if you don't care about this, and you prefer to stick to this number of days no matter the update, you can enable this option.
Instead of comparing the number of days based on the [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `updated_at`, it will be based on the [GitHub issue](https://docs.github.com/en/rest/reference/issues) field `created_at`.
Default value: `false`
#### ignore-issue-updates
Useful to override [ignore-updates](#ignore-updates) but only to ignore the updates for the issues.
Default value: unset
#### ignore-pr-updates
Useful to override [ignore-updates](#ignore-updates) but only to ignore the updates for the pull requests.
Default value: unset
#### include-only-assigned
If set to `true`, only the issues or the pull requests with an assignee will be marked as stale automatically.
Default value: `false`
### Usage
See [action.yml](./action.yml) For comprehensive list of options.
See also [action.yml](./action.yml) for a comprehensive list of all the options.
Basic:
```yaml
name: "Close stale issues"
name: 'Close stale issues and PRs'
on:
schedule:
- cron: "30 1 * * *"
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v7
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Message to comment on stale issues. If none provided, will not mark issues stale'
stale-pr-message: 'Message to comment on stale PRs. If none provided, will not mark PRs stale'
```
Configure stale timeouts:
```yaml
name: "Close stale issues"
name: 'Close stale issues and PRs'
on:
schedule:
- cron: "30 1 * * *"
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v7
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days'
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
days-before-stale: 30
days-before-close: 5
```
Configure labels:
Configure different stale timeouts but never close a PR:
```yaml
name: "Close stale issues"
name: 'Close stale issues and PR'
on:
schedule:
- cron: "30 1 * * *"
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v7
with:
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
days-before-stale: 30
days-before-close: 5
days-before-pr-close: -1
```
Configure different stale timeouts:
```yaml
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
with:
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
days-before-issue-stale: 30
days-before-pr-stale: 45
days-before-issue-close: 5
days-before-pr-close: 10
```
Configure labels:
```yaml
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
@@ -108,6 +647,135 @@ jobs:
only-labels: 'awaiting-feedback,awaiting-answers'
```
Configure the stale action to only stale issue/PR created after the 18th april 2020:
```yaml
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
with:
start-date: '2020-04-18T00:00:00Z' # ISO 8601 or RFC 2822
```
Avoid stale for specific milestones:
```yaml
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
with:
exempt-issue-milestones: 'future,alpha,beta'
exempt-pr-milestones: 'bugfix,improvement'
```
Avoid stale for all PR with milestones:
```yaml
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
with:
exempt-all-pr-milestones: true
```
Check stale for specific labels:
```yaml
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
with:
any-of-labels: 'needs-more-info,needs-demo'
# You can opt for 'only-labels' instead if your use-case requires all labels
# to be present in the issue/PR
```
Avoid stale for specific assignees:
```yaml
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
with:
exempt-issue-assignees: 'marco,polo'
exempt-pr-assignees: 'marco'
```
Avoid stale for all PR with assignees:
```yaml
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
with:
exempt-all-pr-assignees: true
```
### Debugging
To see debug output from this action, you must set the secret `ACTIONS_STEP_DEBUG` to `true` in your repository. You can run this action in debug only mode (no actions will be taken on your issues) by passing `debug-only` `true` as an argument to the action.
**Logs:**
To see the debug output from this action, you must set the secret `ACTIONS_STEP_DEBUG` to `true` in your repository.
There are many logs, so this can be very helpful!
**Statistics:**
If the logs are enabled, you can also enable the statistics log which will be visible at the end of the logs once all issues were processed.
This is very helpful to have a quick understanding of the whole stale workflow.
Set `enable-statistics` to `true` in your workflow configuration file.
**Dry-run:**
You can run this action in debug only mode (no actions will be taken on your issues and pull requests) by passing `debug-only` to `true` as an argument to the action.
**More operations:**
You can increase the maximum number of operations per run by passing `operations-per-run` to `1000` for example which will help you to handle more operations in a single stale workflow run.
If the `debug-only` option is enabled, this is very helpful because the workflow will (almost) never reach the GitHub API rate, and you will be able to deep-dive into the logs.
**Job frequency:**
You could change the cron job frequency in the stale workflow to run the stale workflow more often.
Usually, this is not very helpful though.
### Contributing
We welcome contributions!
Please read the [contributing](CONTRIBUTING.md) file before starting your work.

File diff suppressed because it is too large Load Diff

412
__tests__/assignees.spec.ts Normal file
View File

@@ -0,0 +1,412 @@
import {Issue} from '../src/classes/issue';
import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-options';
import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue';
interface ITestData {
id: number;
isPullRequest: boolean;
assignees: string[];
exemptAllAssignees: boolean;
exemptAllIssueAssignees: boolean | undefined;
exemptAllPrAssignees: boolean | undefined;
exemptAssignees: string;
exemptIssueAssignees: string;
exemptPrAssignees: string;
shouldStale: boolean;
description: string;
}
describe('assignees options', (): void => {
let opts: IIssuesProcessorOptions;
let testIssueList: Issue[];
let processor: IssuesProcessorMock;
const setTestIssueList = (
isPullRequest: boolean,
assignees: string[],
id: number
) => {
testIssueList = [
generateIssue(
opts,
id,
'My first issue',
'2020-01-01T17:00:00Z',
'2020-01-01T17:00:00Z',
isPullRequest,
undefined,
undefined,
undefined,
undefined,
assignees
)
];
};
const setProcessor = () => {
processor = new IssuesProcessorMock(
opts,
async p => (p === 1 ? testIssueList : []),
async () => [],
async () => new Date().toDateString()
);
};
beforeEach((): void => {
opts = {...DefaultProcessorOptions};
});
describe.each`
id | isPullRequest | assignees | exemptAllAssignees | exemptAllIssueAssignees | exemptAllPrAssignees | exemptAssignees | exemptIssueAssignees | exemptPrAssignees | shouldStale | description
${100} | ${false} | ${[]} | ${false} | ${undefined} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee'}
${101} | ${false} | ${[]} | ${true} | ${undefined} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllAssignees is enabled'}
${102} | ${false} | ${[]} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllIssueAssignees is enabled'}
${103} | ${false} | ${[]} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and only exemptAllPrAssignees is enabled'}
${104} | ${false} | ${[]} | ${true} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'}
${105} | ${false} | ${[]} | ${true} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'}
${106} | ${false} | ${[]} | ${true} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'}
${107} | ${false} | ${[]} | ${true} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'}
${108} | ${false} | ${[]} | ${false} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'}
${109} | ${false} | ${[]} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'}
${200} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'}
${201} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'}
${202} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and only exemptAllAssignees is enabled'}
${203} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and only exemptAllIssueAssignees is enabled'}
${204} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and only exemptAllPrAssignees is enabled'}
${205} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'}
${206} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'}
${207} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'}
${208} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'}
${209} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'}
${210} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'}
${211} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'}
${212} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'}
${213} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'}
${300} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'}
${301} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'}
${302} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees has a different assignee'}
${303} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'}
${304} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'}
${305} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'}
${306} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'}
${307} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'}
${308} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'}
${309} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'}
${310} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'}
${311} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'}
${312} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'}
${313} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'}
${400} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'}
${401} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'}
${402} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees has the same assignee'}
${403} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'}
${404} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'}
${405} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'}
${406} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'}
${407} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'}
${408} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'}
${409} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'}
${410} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'}
${411} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'}
${412} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'}
${413} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'}
${500} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${501} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${502} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${503} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${504} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${505} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${506} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${507} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${508} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${509} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${510} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${511} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${512} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${513} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${600} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${601} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${602} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${603} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${604} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${605} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${606} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${607} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${608} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${609} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${610} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${611} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${612} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${613} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${700} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${701} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${702} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${703} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${704} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${705} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${706} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${707} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${708} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${709} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${710} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${711} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${712} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${713} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${800} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${801} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${802} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${803} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${804} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${805} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${806} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${807} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${808} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${809} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${810} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${811} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${812} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${813} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${900} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${901} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${902} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${903} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${904} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${905} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${906} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${907} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${908} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${909} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${910} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${911} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${912} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${913} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${true} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${1000} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${1001} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${1002} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${1003} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${1004} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${1005} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${1006} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${1007} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${1008} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${1009} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${1010} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${1011} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${1012} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${1013} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${1100} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${1101} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${1102} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${1103} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${1104} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${1105} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${1106} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${1107} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${1108} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${1109} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${1110} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${1111} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${1112} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${1113} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${1200} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${1201} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${1202} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${1203} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${1204} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${1205} | ${false} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${1206} | ${false} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${1207} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${1208} | ${false} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${1209} | ${false} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${1210} | ${false} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${1211} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${1212} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${1213} | ${false} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the issue has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${1300} | ${true} | ${[]} | ${false} | ${undefined} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee'}
${1301} | ${true} | ${[]} | ${true} | ${undefined} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllAssignees is enabled'}
${1302} | ${true} | ${[]} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllIssueAssignees is enabled'}
${1303} | ${true} | ${[]} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and only exemptAllPrAssignees is enabled'}
${1304} | ${true} | ${[]} | ${true} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'}
${1305} | ${true} | ${[]} | ${true} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'}
${1306} | ${true} | ${[]} | ${true} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'}
${1307} | ${true} | ${[]} | ${true} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'}
${1308} | ${true} | ${[]} | ${false} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'}
${1309} | ${true} | ${[]} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request does not have an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'}
${1400} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'}
${1401} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'}
${1402} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and only exemptAllAssignees is enabled'}
${1403} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and only exemptAllIssueAssignees is enabled'}
${1404} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and only exemptAllPrAssignees is enabled'}
${1405} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is disabled'}
${1406} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllIssueAssignees is enabled'}
${1407} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is disabled'}
${1408} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAllPrAssignees is enabled'}
${1409} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is disabled'}
${1410} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllIssueAssignees is enabled'}
${1411} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'}
${1412} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${''} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is enabled'}
${1413} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${''} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled and exemptAllPrAssignees is disabled'}
${1500} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'}
${1501} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'}
${1502} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees has a different assignee'}
${1503} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'}
${1504} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'}
${1505} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'}
${1506} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'}
${1507} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'}
${1508} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has a different assignee'}
${1509} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has a different assignee'}
${1510} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has a different assignee'}
${1511} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'}
${1513} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has a different assignee'}
${1600} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'}
${1601} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'}
${1602} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees has the same assignee'}
${1603} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'}
${1604} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'}
${1605} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'}
${1606} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'}
${1607} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'}
${1608} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'}
${1609} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees has the same assignee'}
${1610} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees has the same assignee'}
${1611} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'}
${1612} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees has the same assignee'}
${1613} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees has the same assignee'}
${1701} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${1702} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${1703} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${1704} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${1705} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${1706} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${1707} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${1708} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${1709} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${1710} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${1711} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'bad'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptIssueAssignees has a different assignee'}
${1800} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${1801} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${1802} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${1803} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${1804} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${1805} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${1806} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${1807} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${1808} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${1809} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${1810} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${'assignee'} | ${''} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptIssueAssignees has the same assignee'}
${1900} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${1901} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${1902} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${1903} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${1904} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${1905} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${1906} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${1907} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${1908} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${1909} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${1910} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${1911} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled and exemptAssignees and exemptPrAssignees has a different assignee'}
${2000} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${2001} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${2002} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${2003} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${2004} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${2005} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${2006} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${2007} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${2008} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${2009} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${2010} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'bad'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has a different assignee and exemptPrAssignees has the same assignee'}
${2100} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${2101} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${2102} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${2103} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${2104} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${2105} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${2106} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${2107} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${2108} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${2109} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${2110} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'bad'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has a different assignee'}
${2200} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${2201} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${2202} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${2203} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${2204} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${2205} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${2206} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${2207} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${2208} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${2209} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${2210} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${2311} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${2312} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${2313} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${'assignee'} | ${''} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptIssueAssignees has the same assignee'}
${2300} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${2301} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${2302} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${2303} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${2304} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${2305} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${2306} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${2307} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${2308} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${2309} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${2310} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'bad'} | ${true} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${2311} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'bad'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has a different assignee'}
${2400} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${2401} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${2402} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${2403} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${2404} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${2405} | ${true} | ${['assignee']} | ${true} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${2406} | ${true} | ${['assignee']} | ${true} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${2407} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${2408} | ${true} | ${['assignee']} | ${true} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is enabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${2409} | ${true} | ${['assignee']} | ${false} | ${false} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${2410} | ${true} | ${['assignee']} | ${false} | ${true} | ${undefined} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllIssueAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${2411} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${2412} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${true} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is enabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
${2413} | ${true} | ${['assignee']} | ${false} | ${undefined} | ${false} | ${'assignee'} | ${''} | ${'assignee'} | ${false} | ${'when the pull request has an assignee and exemptAllAssignees is disabled, exemptAllPrAssignees is disabled, exemptAssignees has the same assignee and exemptPrAssignees has the same assignee'}
`(
'$description',
({
id,
isPullRequest,
assignees,
exemptAllAssignees,
exemptAllIssueAssignees,
exemptAllPrAssignees,
exemptAssignees,
exemptIssueAssignees,
exemptPrAssignees,
shouldStale
}: ITestData): void => {
beforeEach((): void => {
opts.exemptAllAssignees = exemptAllAssignees;
opts.exemptAllIssueAssignees = exemptAllIssueAssignees;
opts.exemptAllPrAssignees = exemptAllPrAssignees;
opts.exemptAssignees = exemptAssignees;
opts.exemptIssueAssignees = exemptIssueAssignees;
opts.exemptPrAssignees = exemptPrAssignees;
setTestIssueList(isPullRequest, assignees, id);
setProcessor();
});
test(`should${
shouldStale ? '' : ' not'
} be marked as stale`, async () => {
expect.assertions(3);
await processor.processIssues(1);
expect(processor.staleIssues).toHaveLength(shouldStale ? 1 : 0);
expect(processor.closedIssues).toHaveLength(0);
expect(processor.removedLabelIssues).toHaveLength(0);
});
}
);
});

View File

@@ -0,0 +1,39 @@
import {Issue} from '../../src/classes/issue';
import {IssuesProcessor} from '../../src/classes/issues-processor';
import {IComment} from '../../src/interfaces/comment';
import {IIssuesProcessorOptions} from '../../src/interfaces/issues-processor-options';
import {IPullRequest} from '../../src/interfaces/pull-request';
export class IssuesProcessorMock extends IssuesProcessor {
constructor(
options: IIssuesProcessorOptions,
getIssues?: (page: number) => Promise<Issue[]>,
listIssueComments?: (
issue: Issue,
sinceDate: string
) => Promise<IComment[]>,
getLabelCreationDate?: (
issue: Issue,
label: string
) => Promise<string | undefined>,
getPullRequest?: (issue: Issue) => Promise<IPullRequest | undefined | void>
) {
super(options);
if (getIssues) {
this.getIssues = getIssues;
}
if (listIssueComments) {
this.listIssueComments = listIssueComments;
}
if (getLabelCreationDate) {
this.getLabelCreationDate = getLabelCreationDate;
}
if (getPullRequest) {
this.getPullRequest = getPullRequest;
}
}
}

View File

@@ -0,0 +1,59 @@
import {IIssuesProcessorOptions} from '../../src/interfaces/issues-processor-options';
// Default options for use in tests.
// Mirrors the defaults defined in action.yml
export const DefaultProcessorOptions: IIssuesProcessorOptions = Object.freeze({
repoToken: 'none',
staleIssueMessage: 'This issue is stale',
stalePrMessage: 'This PR is stale',
closeIssueMessage: 'This issue is being closed',
closePrMessage: 'This PR is being closed',
daysBeforeStale: 1,
daysBeforeIssueStale: NaN,
daysBeforePrStale: NaN,
daysBeforeClose: 30,
daysBeforeIssueClose: NaN,
daysBeforePrClose: NaN,
staleIssueLabel: 'Stale',
closeIssueLabel: '',
exemptIssueLabels: '',
stalePrLabel: 'Stale',
closePrLabel: '',
exemptPrLabels: '',
onlyLabels: '',
onlyIssueLabels: '',
onlyPrLabels: '',
anyOfLabels: '',
anyOfIssueLabels: '',
anyOfPrLabels: '',
operationsPerRun: 100,
debugOnly: true,
removeStaleWhenUpdated: false,
removeIssueStaleWhenUpdated: undefined,
removePrStaleWhenUpdated: undefined,
ascending: false,
deleteBranch: false,
startDate: '',
exemptMilestones: '',
exemptIssueMilestones: '',
exemptPrMilestones: '',
exemptAllMilestones: false,
exemptAllIssueMilestones: undefined,
exemptAllPrMilestones: undefined,
exemptAssignees: '',
exemptIssueAssignees: '',
exemptPrAssignees: '',
exemptAllAssignees: false,
exemptAllIssueAssignees: undefined,
exemptAllPrAssignees: undefined,
enableStatistics: true,
labelsToRemoveWhenStale: '',
labelsToRemoveWhenUnstale: '',
labelsToAddWhenUnstale: '',
ignoreUpdates: false,
ignoreIssueUpdates: undefined,
ignorePrUpdates: undefined,
exemptDraftPr: false,
closeIssueReason: 'not_planned',
includeOnlyAssigned: false
});

View File

@@ -0,0 +1,140 @@
import {Issue} from '../src/classes/issue';
import {IIssue} from '../src/interfaces/issue';
import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-options';
import {IPullRequest} from '../src/interfaces/pull-request';
import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue';
let issuesProcessorBuilder: IssuesProcessorBuilder;
let issuesProcessor: IssuesProcessorMock;
describe('exempt-draft-pr option', (): void => {
beforeEach((): void => {
issuesProcessorBuilder = new IssuesProcessorBuilder();
});
describe('when the option "exempt-draft-pr" is disabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.processDraftPr();
});
test('should stale the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder
.toStalePrs([
{
number: 10
}
])
.build();
await issuesProcessor.processIssues();
expect(issuesProcessor.staleIssues).toHaveLength(1);
});
});
describe('when the option "exempt-draft-pr" is enabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.exemptDraftPr();
});
test('should not stale the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder
.toStalePrs([
{
number: 20
}
])
.build();
await issuesProcessor.processIssues();
expect(issuesProcessor.staleIssues).toHaveLength(0);
});
});
});
class IssuesProcessorBuilder {
private _options: IIssuesProcessorOptions = {
...DefaultProcessorOptions
};
private _issues: Issue[] = [];
processDraftPr(): IssuesProcessorBuilder {
this._options.exemptDraftPr = false;
return this;
}
exemptDraftPr(): IssuesProcessorBuilder {
this._options.exemptDraftPr = true;
return this;
}
issuesOrPrs(issues: Partial<IIssue>[]): IssuesProcessorBuilder {
this._issues = issues.map(
(issue: Readonly<Partial<IIssue>>, index: Readonly<number>): Issue =>
generateIssue(
this._options,
issue.number ?? index,
issue.title ?? 'dummy-title',
issue.updated_at ?? new Date().toDateString(),
issue.created_at ?? new Date().toDateString(),
!!issue.pull_request,
issue.labels ? issue.labels.map(label => label.name || '') : []
)
);
return this;
}
prs(issues: Partial<IIssue>[]): IssuesProcessorBuilder {
this.issuesOrPrs(
issues.map((issue: Readonly<Partial<IIssue>>): Partial<IIssue> => {
return {
...issue,
pull_request: {key: 'value'}
};
})
);
return this;
}
toStalePrs(issues: Partial<IIssue>[]): IssuesProcessorBuilder {
this.prs(
issues.map((issue: Readonly<Partial<IIssue>>): Partial<IIssue> => {
return {
...issue,
updated_at: '2020-01-01T17:00:00Z',
created_at: '2020-01-01T17:00:00Z'
};
})
);
return this;
}
build(): IssuesProcessorMock {
return new IssuesProcessorMock(
this._options,
async p => (p === 1 ? this._issues : []),
async () => [],
async () => new Date().toDateString(),
async (): Promise<IPullRequest> => {
return Promise.resolve({
number: 0,
draft: true,
head: {
ref: 'ref',
repo: null
}
});
}
);
}
}

View File

@@ -0,0 +1,19 @@
import {IIssue} from '../../src/interfaces/issue';
export function generateIIssue(
partialIssue?: Readonly<Partial<IIssue>>
): IIssue {
return {
milestone: undefined,
assignees: [],
labels: [],
created_at: new Date().toISOString(),
updated_at: new Date().toISOString(),
number: Math.round(Math.random() * 5000),
pull_request: null,
title: 'dummy-title',
locked: false,
state: 'dummy-state',
...partialIssue
};
}

View File

@@ -0,0 +1,42 @@
import {Issue} from '../../src/classes/issue';
import {IUserAssignee} from '../../src/interfaces/assignee';
import {IIssuesProcessorOptions} from '../../src/interfaces/issues-processor-options';
import {IsoDateString} from '../../src/types/iso-date-string';
export function generateIssue(
options: IIssuesProcessorOptions,
id: number,
title: string,
updatedAt: IsoDateString,
createdAt: IsoDateString = updatedAt,
isPullRequest = false,
labels: string[] = [],
isClosed = false,
isLocked = false,
milestone: string | undefined = undefined,
assignees: string[] = []
): Issue {
return new Issue(options, {
number: id,
labels: labels.map(l => {
return {name: l};
}),
title,
created_at: createdAt,
updated_at: updatedAt,
pull_request: isPullRequest ? {} : null,
state: isClosed ? 'closed' : 'open',
locked: isLocked,
milestone: milestone
? {
title: milestone
}
: undefined,
assignees: assignees.map((assignee: Readonly<string>): IUserAssignee => {
return {
login: assignee,
type: 'User'
};
})
});
}

2601
__tests__/main.spec.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,897 +0,0 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import {Octokit} from '@octokit/rest';
import {
IssueProcessor,
Issue,
Label,
IssueProcessorOptions
} from '../src/IssueProcessor';
function generateIssue(
id: number,
title: string,
updatedAt: string,
isPullRequest: boolean = false,
labels: string[] = [],
isClosed: boolean = false,
isLocked: boolean = false
): Issue {
return {
number: id,
labels: labels.map(l => {
return {name: l};
}),
title: title,
updated_at: updatedAt,
pull_request: isPullRequest ? {} : null,
state: isClosed ? 'closed' : 'open',
locked: isLocked
};
}
const DefaultProcessorOptions: IssueProcessorOptions = Object.freeze({
repoToken: 'none',
staleIssueMessage: 'This issue is stale',
stalePrMessage: 'This PR is stale',
closeIssueMessage: 'This issue is being closed',
closePrMessage: 'This PR is being closed',
daysBeforeStale: 1,
daysBeforeClose: 30,
staleIssueLabel: 'Stale',
closeIssueLabel: '',
exemptIssueLabels: '',
stalePrLabel: 'Stale',
closePrLabel: '',
exemptPrLabels: '',
onlyLabels: '',
operationsPerRun: 100,
debugOnly: true,
removeStaleWhenUpdated: false,
ascending: false,
skipStaleIssueMessage: false,
skipStalePrMessage: false
});
test('empty issue list results in 1 operation', async () => {
const processor = new IssueProcessor(
DefaultProcessorOptions,
async () => [],
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
const operationsLeft = await processor.processIssues(1);
// processing an empty issue list should result in 1 operation
expect(operationsLeft).toEqual(99);
});
test('processing an issue with no label will make it stale and close it, if it is old enough only if days-before-close is set to 0', async () => {
const TestIssueList: Issue[] = [
generateIssue(1, 'An issue with no label', '2020-01-01T17:00:00Z')
];
const opts = {...DefaultProcessorOptions};
opts.daysBeforeClose = 0;
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(1);
expect(processor.closedIssues.length).toEqual(1);
});
test('processing an issue with no label will make it stale and not close it if days-before-close is set to > 0', async () => {
const TestIssueList: Issue[] = [
generateIssue(1, 'An issue with no label', '2020-01-01T17:00:00Z')
];
const opts = {...DefaultProcessorOptions};
opts.daysBeforeClose = 15;
const processor = new IssueProcessor(
DefaultProcessorOptions,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(1);
expect(processor.closedIssues.length).toEqual(0);
});
test('processing an issue with no label will not make it stale if days-before-stale is set to -1', async () => {
const TestIssueList: Issue[] = [
generateIssue(1, 'An issue with no label', '2020-01-01T17:00:00Z')
];
const opts = {
...DefaultProcessorOptions,
staleIssueMessage: '',
daysBeforeStale: -1
};
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(0);
});
test('processing an issue with no label will make it stale but not close it', async () => {
// issue should be from 2 days ago so it will be
// stale but not close-able, based on default settings
let issueDate = new Date();
issueDate.setDate(issueDate.getDate() - 2);
const TestIssueList: Issue[] = [
generateIssue(1, 'An issue with no label', issueDate.toDateString())
];
const processor = new IssueProcessor(
DefaultProcessorOptions,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(1);
expect(processor.closedIssues.length).toEqual(0);
});
test('processing a stale issue will close it', async () => {
const TestIssueList: Issue[] = [
generateIssue(
1,
'A stale issue that should be closed',
'2020-01-01T17:00:00Z',
false,
['Stale']
)
];
const processor = new IssueProcessor(
DefaultProcessorOptions,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(1);
});
test('processing a stale PR will close it', async () => {
const TestIssueList: Issue[] = [
generateIssue(
1,
'A stale PR that should be closed',
'2020-01-01T17:00:00Z',
true,
['Stale']
)
];
const processor = new IssueProcessor(
DefaultProcessorOptions,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(1);
});
test('processing a stale issue will close it even if configured not to mark as stale', async () => {
const TestIssueList: Issue[] = [
generateIssue(1, 'An issue with no label', '2020-01-01T17:00:00Z', false, [
'Stale'
])
];
const opts = {
...DefaultProcessorOptions,
daysBeforeStale: -1,
staleIssueMessage: ''
};
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(1);
});
test('processing a stale PR will close it even if configured not to mark as stale', async () => {
const TestIssueList: Issue[] = [
generateIssue(1, 'An issue with no label', '2020-01-01T17:00:00Z', true, [
'Stale'
])
];
const opts = {
...DefaultProcessorOptions,
daysBeforeStale: -1,
stalePrMessage: ''
};
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(1);
});
test('closed issues will not be marked stale', async () => {
const TestIssueList: Issue[] = [
generateIssue(
1,
'A closed issue that will not be marked',
'2020-01-01T17:00:00Z',
false,
[],
true
)
];
const processor = new IssueProcessor(
DefaultProcessorOptions,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => []
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(0);
});
test('stale closed issues will not be closed', async () => {
const TestIssueList: Issue[] = [
generateIssue(
1,
'A stale closed issue',
'2020-01-01T17:00:00Z',
false,
['Stale'],
true
)
];
const processor = new IssueProcessor(
DefaultProcessorOptions,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(0);
});
test('closed prs will not be marked stale', async () => {
const TestIssueList: Issue[] = [
generateIssue(
1,
'A closed PR that will not be marked',
'2020-01-01T17:00:00Z',
true,
[],
true
)
];
const processor = new IssueProcessor(
DefaultProcessorOptions,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(0);
});
test('stale closed prs will not be closed', async () => {
const TestIssueList: Issue[] = [
generateIssue(
1,
'A stale closed PR that will not be closed again',
'2020-01-01T17:00:00Z',
true,
['Stale'],
true
)
];
const processor = new IssueProcessor(
DefaultProcessorOptions,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(0);
});
test('locked issues will not be marked stale', async () => {
const TestIssueList: Issue[] = [
generateIssue(
1,
'A locked issue that will not be stale',
'2020-01-01T17:00:00Z',
false,
[],
false,
true
)
];
const processor = new IssueProcessor(DefaultProcessorOptions, async p =>
p == 1 ? TestIssueList : []
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(0);
});
test('stale locked issues will not be closed', async () => {
const TestIssueList: Issue[] = [
generateIssue(
1,
'A stale locked issue that will not be closed',
'2020-01-01T17:00:00Z',
false,
['Stale'],
false,
true
)
];
const processor = new IssueProcessor(
DefaultProcessorOptions,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(0);
});
test('locked prs will not be marked stale', async () => {
const TestIssueList: Issue[] = [
generateIssue(
1,
'A locked PR that will not be marked stale',
'2020-01-01T17:00:00Z',
true,
[],
false,
true
)
];
const processor = new IssueProcessor(DefaultProcessorOptions, async p =>
p == 1 ? TestIssueList : []
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(0);
});
test('stale locked prs will not be closed', async () => {
const TestIssueList: Issue[] = [
generateIssue(
1,
'A stale locked PR that will not be closed',
'2020-01-01T17:00:00Z',
true,
['Stale'],
false,
true
)
];
const processor = new IssueProcessor(
DefaultProcessorOptions,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(0);
});
test('exempt issue labels will not be marked stale', async () => {
const TestIssueList: Issue[] = [
generateIssue(1, 'My first issue', '2020-01-01T17:00:00Z', false, [
'Exempt'
])
];
const opts = {...DefaultProcessorOptions};
opts.exemptIssueLabels = 'Exempt';
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(0);
});
test('exempt issue labels will not be marked stale (multi issue label with spaces)', async () => {
const TestIssueList: Issue[] = [
generateIssue(1, 'My first issue', '2020-01-01T17:00:00Z', false, ['Cool'])
];
const opts = {...DefaultProcessorOptions};
opts.exemptIssueLabels = 'Exempt, Cool, None';
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(0);
});
test('exempt issue labels will not be marked stale (multi issue label)', async () => {
const TestIssueList: Issue[] = [
generateIssue(1, 'My first issue', '2020-01-01T17:00:00Z', false, ['Cool'])
];
const opts = {...DefaultProcessorOptions};
opts.exemptIssueLabels = 'Exempt,Cool,None';
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.closedIssues.length).toEqual(0);
expect(processor.removedLabelIssues.length).toEqual(0);
});
test('exempt pr labels will not be marked stale', async () => {
const TestIssueList: Issue[] = [
generateIssue(1, 'My first issue', '2020-01-01T17:00:00Z', false, ['Cool']),
generateIssue(2, 'My first PR', '2020-01-01T17:00:00Z', true, ['Cool']),
generateIssue(3, 'Another issue', '2020-01-01T17:00:00Z', false)
];
const opts = {...DefaultProcessorOptions};
opts.exemptIssueLabels = 'Cool';
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.staleIssues.length).toEqual(2); // PR should get processed even though it has an exempt **issue** label
});
test('stale issues should not be closed if days is set to -1', async () => {
const TestIssueList: Issue[] = [
generateIssue(1, 'My first issue', '2020-01-01T17:00:00Z', false, [
'Stale'
]),
generateIssue(2, 'My first PR', '2020-01-01T17:00:00Z', true, ['Stale']),
generateIssue(3, 'Another issue', '2020-01-01T17:00:00Z', false, ['Stale'])
];
const opts = {...DefaultProcessorOptions};
opts.daysBeforeClose = -1;
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.closedIssues.length).toEqual(0);
expect(processor.removedLabelIssues.length).toEqual(0);
});
test('stale label should be removed if a comment was added to a stale issue', async () => {
const TestIssueList: Issue[] = [
generateIssue(
1,
'An issue that should un-stale',
'2020-01-01T17:00:00Z',
false,
['Stale']
)
];
const opts = {...DefaultProcessorOptions};
opts.removeStaleWhenUpdated = true;
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [{user: {login: 'notme', type: 'User'}}], // return a fake comment to indicate there was an update
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.closedIssues.length).toEqual(0);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.removedLabelIssues.length).toEqual(1);
});
test('stale label should not be removed if a comment was added by the bot (and the issue should be closed)', async () => {
github.context.actor = 'abot';
const TestIssueList: Issue[] = [
generateIssue(
1,
'An issue that should stay stale',
'2020-01-01T17:00:00Z',
false,
['Stale']
)
];
const opts = {...DefaultProcessorOptions};
opts.removeStaleWhenUpdated = true;
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [{user: {login: 'abot', type: 'User'}}], // return a fake comment to indicate there was an update by the bot
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.closedIssues.length).toEqual(1);
expect(processor.staleIssues.length).toEqual(0);
expect(processor.removedLabelIssues.length).toEqual(0);
});
test('stale issues should not be closed until after the closed number of days', async () => {
let lastUpdate = new Date();
lastUpdate.setDate(lastUpdate.getDate() - 5);
const TestIssueList: Issue[] = [
generateIssue(
1,
'An issue that should be marked stale but not closed',
lastUpdate.toString(),
false
)
];
const opts = {...DefaultProcessorOptions};
opts.daysBeforeStale = 5; // stale after 5 days
opts.daysBeforeClose = 1; // closes after 6 days
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.closedIssues.length).toEqual(0);
expect(processor.removedLabelIssues.length).toEqual(0);
expect(processor.staleIssues.length).toEqual(1);
});
test('stale issues should be closed if the closed nubmer of days (additive) is also passed', async () => {
let lastUpdate = new Date();
lastUpdate.setDate(lastUpdate.getDate() - 7);
const TestIssueList: Issue[] = [
generateIssue(
1,
'An issue that should be stale and closed',
lastUpdate.toString(),
false,
['Stale']
)
];
const opts = {...DefaultProcessorOptions};
opts.daysBeforeStale = 5; // stale after 5 days
opts.daysBeforeClose = 1; // closes after 6 days
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.closedIssues.length).toEqual(1);
expect(processor.removedLabelIssues.length).toEqual(0);
expect(processor.staleIssues.length).toEqual(0);
});
test('stale issues should not be closed until after the closed number of days (long)', async () => {
let lastUpdate = new Date();
lastUpdate.setDate(lastUpdate.getDate() - 10);
const TestIssueList: Issue[] = [
generateIssue(
1,
'An issue that should be marked stale but not closed',
lastUpdate.toString(),
false
)
];
const opts = {...DefaultProcessorOptions};
opts.daysBeforeStale = 5; // stale after 5 days
opts.daysBeforeClose = 20; // closes after 25 days
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// process our fake issue list
await processor.processIssues(1);
expect(processor.closedIssues.length).toEqual(0);
expect(processor.removedLabelIssues.length).toEqual(0);
expect(processor.staleIssues.length).toEqual(1);
});
test('skips stale message on issues when skip-stale-issue-message is set', async () => {
let lastUpdate = new Date();
lastUpdate.setDate(lastUpdate.getDate() - 10);
const TestIssueList: Issue[] = [
generateIssue(
1,
'An issue that should be marked stale but not closed',
lastUpdate.toString(),
false
)
];
const opts = {...DefaultProcessorOptions};
opts.daysBeforeStale = 5; // stale after 5 days
opts.daysBeforeClose = 20; // closes after 25 days
opts.skipStaleIssueMessage = true;
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// for sake of testing, mocking private function
const markSpy = jest.spyOn(processor as any, 'markStale');
await processor.processIssues(1);
// issue should be staled
expect(processor.closedIssues.length).toEqual(0);
expect(processor.removedLabelIssues.length).toEqual(0);
expect(processor.staleIssues.length).toEqual(1);
// comment should not be created
expect(markSpy).toHaveBeenCalledWith(
TestIssueList[0],
opts.staleIssueMessage,
opts.staleIssueLabel,
// this option is skipMessage
true
);
});
test('skips stale message on prs when skip-stale-pr-message is set', async () => {
let lastUpdate = new Date();
lastUpdate.setDate(lastUpdate.getDate() - 10);
const TestIssueList: Issue[] = [
generateIssue(
1,
'An issue that should be marked stale but not closed',
lastUpdate.toString(),
true
)
];
const opts = {...DefaultProcessorOptions};
opts.daysBeforeStale = 5; // stale after 5 days
opts.daysBeforeClose = 20; // closes after 25 days
opts.skipStalePrMessage = true;
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
// for sake of testing, mocking private function
const markSpy = jest.spyOn(processor as any, 'markStale');
await processor.processIssues(1);
// issue should be staled
expect(processor.closedIssues.length).toEqual(0);
expect(processor.removedLabelIssues.length).toEqual(0);
expect(processor.staleIssues.length).toEqual(1);
// comment should not be created
expect(markSpy).toHaveBeenCalledWith(
TestIssueList[0],
opts.stalePrMessage,
opts.stalePrLabel,
// this option is skipMessage
true
);
});
test('not providing state takes precedence over skipStaleIssueMessage', async () => {
let lastUpdate = new Date();
lastUpdate.setDate(lastUpdate.getDate() - 10);
const TestIssueList: Issue[] = [
generateIssue(
1,
'An issue that should be marked stale but not closed',
lastUpdate.toString(),
false
)
];
const opts = {...DefaultProcessorOptions};
opts.daysBeforeStale = 5; // stale after 5 days
opts.daysBeforeClose = 20; // closes after 25 days
opts.skipStalePrMessage = true;
opts.staleIssueMessage = '';
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
await processor.processIssues(1);
// issue should be staled
expect(processor.closedIssues.length).toEqual(0);
expect(processor.removedLabelIssues.length).toEqual(0);
expect(processor.staleIssues.length).toEqual(0);
});
test('not providing stalePrMessage takes precedence over skipStalePrMessage', async () => {
let lastUpdate = new Date();
lastUpdate.setDate(lastUpdate.getDate() - 10);
const TestIssueList: Issue[] = [
generateIssue(
1,
'An issue that should be marked stale but not closed',
lastUpdate.toString(),
true
)
];
const opts = {...DefaultProcessorOptions};
opts.daysBeforeStale = 5; // stale after 5 days
opts.daysBeforeClose = 20; // closes after 25 days
opts.skipStalePrMessage = true;
opts.stalePrMessage = '';
const processor = new IssueProcessor(
opts,
async p => (p == 1 ? TestIssueList : []),
async (num, dt) => [],
async (issue, label) => new Date().toDateString()
);
await processor.processIssues(1);
// issue should be staled
expect(processor.closedIssues.length).toEqual(0);
expect(processor.removedLabelIssues.length).toEqual(0);
expect(processor.staleIssues.length).toEqual(0);
});

3411
__tests__/milestones.spec.ts Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,227 @@
import {Issue} from '../src/classes/issue';
import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-options';
import {IsoDateString} from '../src/types/iso-date-string';
import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue';
describe('operations-per-run option', (): void => {
let sut: SUT;
beforeEach((): void => {
sut = new SUT();
});
describe('when one issue should be stale within 10 days and updated 20 days ago', (): void => {
beforeEach((): void => {
sut.staleIn(10).newIssue().updated(20);
});
describe('when the operations per run option is set to 1', (): void => {
beforeEach((): void => {
sut.operationsPerRun(1);
});
it('should consume 1 operation (stale label)', async () => {
expect.assertions(2);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(
sut.processor.operations.getConsumedOperationsCount()
).toStrictEqual(1);
});
});
});
describe('when one issue should be stale within 10 days and updated 20 days ago and a comment should be added when stale', (): void => {
beforeEach((): void => {
sut.staleIn(10).commentOnStale().newIssue().updated(20);
});
describe('when the operations per run option is set to 2', (): void => {
beforeEach((): void => {
sut.operationsPerRun(2);
});
it('should consume 2 operations (stale label, comment)', async () => {
expect.assertions(2);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(
sut.processor.operations.getConsumedOperationsCount()
).toStrictEqual(2);
});
});
// Special case were we continue the issue processing even if the operations per run is reached
describe('when the operations per run option is set to 1', (): void => {
beforeEach((): void => {
sut.operationsPerRun(1);
});
it('should consume 2 operations (stale label, comment)', async () => {
expect.assertions(2);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(
sut.processor.operations.getConsumedOperationsCount()
).toStrictEqual(2);
});
});
});
describe('when two issues should be stale within 10 days and updated 20 days ago and a comment should be added when stale', (): void => {
beforeEach((): void => {
sut.staleIn(10).commentOnStale();
sut.newIssue().updated(20);
sut.newIssue().updated(20);
});
describe('when the operations per run option is set to 3', (): void => {
beforeEach((): void => {
sut.operationsPerRun(3);
});
it('should consume 4 operations (stale label, comment)', async () => {
expect.assertions(2);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(2);
expect(
sut.processor.operations.getConsumedOperationsCount()
).toStrictEqual(4);
});
});
describe('when the operations per run option is set to 2', (): void => {
beforeEach((): void => {
sut.operationsPerRun(2);
});
it('should consume 2 operations (stale label, comment) and stop', async () => {
expect.assertions(2);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(
sut.processor.operations.getConsumedOperationsCount()
).toStrictEqual(2);
});
});
// Special case were we continue the issue processing even if the operations per run is reached
describe('when the operations per run option is set to 1', (): void => {
beforeEach((): void => {
sut.operationsPerRun(1);
});
it('should consume 2 operations (stale label, comment) and stop', async () => {
expect.assertions(2);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(
sut.processor.operations.getConsumedOperationsCount()
).toStrictEqual(2);
});
});
});
});
class SUT {
processor!: IssuesProcessorMock;
private _opts: IIssuesProcessorOptions = {
...DefaultProcessorOptions,
staleIssueMessage: ''
};
private _testIssueList: Issue[] = [];
private _sutIssues: SUTIssue[] = [];
newIssue(): SUTIssue {
const sutIssue: SUTIssue = new SUTIssue();
this._sutIssues.push(sutIssue);
return sutIssue;
}
staleIn(days: number): SUT {
this._updateOptions({
daysBeforeIssueStale: days
});
return this;
}
commentOnStale(): SUT {
this._updateOptions({
staleIssueMessage: 'Dummy stale issue message'
});
return this;
}
operationsPerRun(count: number): SUT {
this._updateOptions({
operationsPerRun: count
});
return this;
}
async test(): Promise<number> {
return this._setTestIssueList()._setProcessor();
}
private _updateOptions(opts: Partial<IIssuesProcessorOptions>): SUT {
this._opts = {...this._opts, ...opts};
return this;
}
private _setTestIssueList(): SUT {
this._testIssueList = this._sutIssues.map((sutIssue: SUTIssue): Issue => {
return generateIssue(
this._opts,
1,
'My first issue',
sutIssue.updatedAt,
sutIssue.updatedAt,
false
);
});
return this;
}
private async _setProcessor(): Promise<number> {
this.processor = new IssuesProcessorMock(
this._opts,
async p => (p === 1 ? this._testIssueList : []),
async () => [],
async () => new Date().toDateString()
);
return this.processor.processIssues(1);
}
}
class SUTIssue {
updatedAt: IsoDateString = '2020-01-01T17:00:00Z';
updated(daysAgo: number): SUTIssue {
const today = new Date();
today.setDate(today.getDate() - daysAgo);
this.updatedAt = today.toISOString();
return this;
}
}

View File

@@ -0,0 +1,555 @@
import {Issue} from '../src/classes/issue';
import {IIssue} from '../src/interfaces/issue';
import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-options';
import {ILabel} from '../src/interfaces/label';
import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue';
let issuesProcessorBuilder: IssuesProcessorBuilder;
let issuesProcessor: IssuesProcessorMock;
/**
* @description
* Assuming there is a comment on the issue
*/
describe('remove-stale-when-updated option', (): void => {
beforeEach((): void => {
issuesProcessorBuilder = new IssuesProcessorBuilder();
});
describe('when the option "remove-stale-when-updated" is disabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.keepStaleWhenUpdated();
});
test('should not remove the stale label on the issue', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(0);
});
test('should not remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the option "remove-stale-when-updated" is enabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.removeStaleWhenUpdated();
});
test('should remove the stale label on the issue', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(1);
});
test('should remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(1);
});
});
});
describe('remove-issue-stale-when-updated option', (): void => {
beforeEach((): void => {
issuesProcessorBuilder = new IssuesProcessorBuilder();
});
describe('when the option "remove-stale-when-updated" is disabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.keepStaleWhenUpdated();
});
describe('when the option "remove-issue-stale-when-updated" is unset', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.unsetIssueStaleWhenUpdated();
});
test('should not remove the stale label on the issue', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(0);
});
test('should not remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the option "remove-issue-stale-when-updated" is disabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.keepIssueStaleWhenUpdated();
});
test('should not remove the stale label on the issue', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(0);
});
test('should not remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the option "remove-issue-stale-when-updated" is enabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.removeIssueStaleWhenUpdated();
});
test('should remove the stale label on the issue', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(1);
});
test('should not remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(0);
});
});
});
describe('when the option "remove-stale-when-updated" is enabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.removeStaleWhenUpdated();
});
describe('when the option "remove-issue-stale-when-updated" is unset', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.unsetIssueStaleWhenUpdated();
});
test('should remove the stale label on the issue', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(1);
});
test('should remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(1);
});
});
describe('when the option "remove-issue-stale-when-updated" is disabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.keepIssueStaleWhenUpdated();
});
test('should not remove the stale label on the issue', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(0);
});
test('should remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(1);
});
});
describe('when the option "remove-issue-stale-when-updated" is enabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.removeIssueStaleWhenUpdated();
});
test('should remove the stale label on the issue', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(1);
});
test('should remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(1);
});
});
});
});
describe('remove-pr-stale-when-updated option', (): void => {
beforeEach((): void => {
issuesProcessorBuilder = new IssuesProcessorBuilder();
});
describe('when the option "remove-stale-when-updated" is disabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.keepStaleWhenUpdated();
});
describe('when the option "remove-pr-stale-when-updated" is unset', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.unsetPrStaleWhenUpdated();
});
test('should not remove the stale label on the issue', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(0);
});
test('should not remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the option "remove-pr-stale-when-updated" is disabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.keepPrStaleWhenUpdated();
});
test('should not remove the stale label on the issue', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(0);
});
test('should not remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the option "remove-pr-stale-when-updated" is enabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.removePrStaleWhenUpdated();
});
test('should not remove the stale label on the issue', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(0);
});
test('should remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(1);
});
});
});
describe('when the option "remove-stale-when-updated" is enabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.removeStaleWhenUpdated();
});
describe('when the option "remove-pr-stale-when-updated" is unset', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.unsetPrStaleWhenUpdated();
});
test('should remove the stale label on the issue', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(1);
});
test('should remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(1);
});
});
describe('when the option "remove-pr-stale-when-updated" is disabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.keepPrStaleWhenUpdated();
});
test('should remove the stale label on the issue', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(1);
});
test('should not remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the option "remove-pr-stale-when-updated" is enabled', (): void => {
beforeEach((): void => {
issuesProcessorBuilder.removePrStaleWhenUpdated();
});
test('should remove the stale label on the issue', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.staleIssues([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(1);
});
test('should remove the stale label on the pull request', async (): Promise<void> => {
expect.assertions(1);
issuesProcessor = issuesProcessorBuilder.stalePrs([{}]).build();
await issuesProcessor.processIssues();
expect(issuesProcessor.removedLabelIssues).toHaveLength(1);
});
});
});
});
class IssuesProcessorBuilder {
private _options: IIssuesProcessorOptions = {
...DefaultProcessorOptions
};
private _issues: Issue[] = [];
keepStaleWhenUpdated(): IssuesProcessorBuilder {
this._options.removeStaleWhenUpdated = false;
return this;
}
removeStaleWhenUpdated(): IssuesProcessorBuilder {
this._options.removeStaleWhenUpdated = true;
return this;
}
unsetIssueStaleWhenUpdated(): IssuesProcessorBuilder {
delete this._options.removeIssueStaleWhenUpdated;
return this;
}
keepIssueStaleWhenUpdated(): IssuesProcessorBuilder {
this._options.removeIssueStaleWhenUpdated = false;
return this;
}
removeIssueStaleWhenUpdated(): IssuesProcessorBuilder {
this._options.removeIssueStaleWhenUpdated = true;
return this;
}
unsetPrStaleWhenUpdated(): IssuesProcessorBuilder {
delete this._options.removePrStaleWhenUpdated;
return this;
}
keepPrStaleWhenUpdated(): IssuesProcessorBuilder {
this._options.removePrStaleWhenUpdated = false;
return this;
}
removePrStaleWhenUpdated(): IssuesProcessorBuilder {
this._options.removePrStaleWhenUpdated = true;
return this;
}
issuesOrPrs(issues: Partial<IIssue>[]): IssuesProcessorBuilder {
this._issues = issues.map(
(issue: Readonly<Partial<IIssue>>, index: Readonly<number>): Issue =>
generateIssue(
this._options,
index,
issue.title ?? 'dummy-title',
issue.updated_at ?? new Date().toDateString(),
issue.created_at ?? new Date().toDateString(),
!!issue.pull_request,
issue.labels ? issue.labels.map(label => label.name || '') : []
)
);
return this;
}
issues(issues: Partial<IIssue>[]): IssuesProcessorBuilder {
this.issuesOrPrs(
issues.map((issue: Readonly<Partial<IIssue>>): Partial<IIssue> => {
return {
...issue,
pull_request: null
};
})
);
return this;
}
staleIssues(issues: Partial<IIssue>[]): IssuesProcessorBuilder {
this.issues(
issues.map((issue: Readonly<Partial<IIssue>>): Partial<IIssue> => {
return {
...issue,
updated_at: '2020-01-01T17:00:00Z',
created_at: '2020-01-01T17:00:00Z',
labels: issue.labels?.map((label: Readonly<ILabel>): ILabel => {
return {
...label,
name: 'Stale'
};
}) ?? [
{
name: 'Stale'
}
]
};
})
);
return this;
}
prs(issues: Partial<IIssue>[]): IssuesProcessorBuilder {
this.issuesOrPrs(
issues.map((issue: Readonly<Partial<IIssue>>): Partial<IIssue> => {
return {
...issue,
pull_request: {key: 'value'}
};
})
);
return this;
}
stalePrs(issues: Partial<IIssue>[]): IssuesProcessorBuilder {
this.prs(
issues.map((issue: Readonly<Partial<IIssue>>): Partial<IIssue> => {
return {
...issue,
updated_at: '2020-01-01T17:00:00Z',
created_at: '2020-01-01T17:00:00Z',
labels: issue.labels?.map((label: Readonly<ILabel>): ILabel => {
return {
...label,
name: 'Stale'
};
}) ?? [
{
name: 'Stale'
}
]
};
})
);
return this;
}
build(): IssuesProcessorMock {
return new IssuesProcessorMock(
this._options,
async p => (p === 1 ? this._issues : []),
async () => [
{
user: {
login: 'notme',
type: 'User'
},
body: 'body'
}
],
async () => new Date().toDateString()
);
}
}

View File

@@ -0,0 +1,696 @@
import {Issue} from '../src/classes/issue';
import {IIssuesProcessorOptions} from '../src/interfaces/issues-processor-options';
import {IsoDateString} from '../src/types/iso-date-string';
import {IssuesProcessorMock} from './classes/issues-processor-mock';
import {DefaultProcessorOptions} from './constants/default-processor-options';
import {generateIssue} from './functions/generate-issue';
describe('ignore-updates options', (): void => {
let sut: SUT;
beforeEach((): void => {
sut = new SUT();
});
describe('when the issue should be stale within 10 days and was created 20 days ago and updated 5 days ago', (): void => {
beforeEach((): void => {
sut.toIssue().staleIn(10).created(20).updated(5);
});
describe('when the ignore updates option is disabled', (): void => {
beforeEach((): void => {
sut.staleOnUpdates();
});
it('should not stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(0);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
describe('when the ignore issue updates option is enabled', (): void => {
beforeEach((): void => {
sut.ignoreIssueUpdates();
});
it('should stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore issue updates option is disabled', (): void => {
beforeEach((): void => {
sut.staleOnIssueUpdates();
});
it('should not stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(0);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore issue updates option is unset', (): void => {
beforeEach((): void => {
sut.unsetIgnoreIssueUpdates();
});
it('should not stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(0);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
});
describe('when the ignore updates option is enabled', (): void => {
beforeEach((): void => {
sut.ignoreUpdates();
});
it('should stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
describe('when the ignore issue updates option is enabled', (): void => {
beforeEach((): void => {
sut.ignoreIssueUpdates();
});
it('should stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore issue updates option is disabled', (): void => {
beforeEach((): void => {
sut.staleOnIssueUpdates();
});
it('should not stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(0);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore issue updates option is unset', (): void => {
beforeEach((): void => {
sut.unsetIgnoreIssueUpdates();
});
it('should stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
});
});
describe('when the issue should be stale within 10 days and was created 20 days ago and updated 15 days ago', (): void => {
beforeEach((): void => {
sut.toIssue().staleIn(10).created(20).updated(15);
});
describe('when the ignore updates option is disabled', (): void => {
beforeEach((): void => {
sut.staleOnUpdates();
});
it('should stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
describe('when the ignore issue updates option is enabled', (): void => {
beforeEach((): void => {
sut.ignoreIssueUpdates();
});
it('should stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore issue updates option is disabled', (): void => {
beforeEach((): void => {
sut.staleOnIssueUpdates();
});
it('should stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore issue updates option is unset', (): void => {
beforeEach((): void => {
sut.unsetIgnoreIssueUpdates();
});
it('should stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
});
describe('when the ignore updates option is enabled', (): void => {
beforeEach((): void => {
sut.ignoreUpdates();
});
it('should stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
describe('when the ignore issue updates option is enabled', (): void => {
beforeEach((): void => {
sut.ignoreIssueUpdates();
});
it('should stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore issue updates option is disabled', (): void => {
beforeEach((): void => {
sut.staleOnIssueUpdates();
});
it('should stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore issue updates option is unset', (): void => {
beforeEach((): void => {
sut.unsetIgnoreIssueUpdates();
});
it('should stale the issue', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
});
});
describe('when the pull request should be stale within 10 days and was created 20 days ago and updated 5 days ago', (): void => {
beforeEach((): void => {
sut.toPullRequest().staleIn(10).created(20).updated(5);
});
describe('when the ignore updates option is disabled', (): void => {
beforeEach((): void => {
sut.staleOnUpdates();
});
it('should not stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(0);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
describe('when the ignore pull request updates option is enabled', (): void => {
beforeEach((): void => {
sut.ignorePullRequestUpdates();
});
it('should stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore pull request updates option is disabled', (): void => {
beforeEach((): void => {
sut.staleOnPullRequestUpdates();
});
it('should not stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(0);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore pull request updates option is unset', (): void => {
beforeEach((): void => {
sut.unsetIgnorePullRequestUpdates();
});
it('should not stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(0);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
});
describe('when the ignore updates option is enabled', (): void => {
beforeEach((): void => {
sut.ignoreUpdates();
});
it('should stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
describe('when the ignore pull request updates option is enabled', (): void => {
beforeEach((): void => {
sut.ignorePullRequestUpdates();
});
it('should stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore pull request updates option is disabled', (): void => {
beforeEach((): void => {
sut.staleOnPullRequestUpdates();
});
it('should not stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(0);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore pull request updates option is unset', (): void => {
beforeEach((): void => {
sut.unsetIgnorePullRequestUpdates();
});
it('should stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
});
});
describe('when the pull request should be stale within 10 days and was created 20 days ago and updated 15 days ago', (): void => {
beforeEach((): void => {
sut.toPullRequest().staleIn(10).created(20).updated(15);
});
describe('when the ignore updates option is disabled', (): void => {
beforeEach((): void => {
sut.staleOnUpdates();
});
it('should stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
describe('when the ignore pull request updates option is enabled', (): void => {
beforeEach((): void => {
sut.ignorePullRequestUpdates();
});
it('should stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore pull request updates option is disabled', (): void => {
beforeEach((): void => {
sut.staleOnPullRequestUpdates();
});
it('should stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore pull request updates option is unset', (): void => {
beforeEach((): void => {
sut.unsetIgnorePullRequestUpdates();
});
it('should stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
});
describe('when the ignore updates option is enabled', (): void => {
beforeEach((): void => {
sut.ignoreUpdates();
});
it('should stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
describe('when the ignore pull request updates option is enabled', (): void => {
beforeEach((): void => {
sut.ignorePullRequestUpdates();
});
it('should stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore pull request updates option is disabled', (): void => {
beforeEach((): void => {
sut.staleOnPullRequestUpdates();
});
it('should stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
describe('when the ignore pull request updates option is unset', (): void => {
beforeEach((): void => {
sut.unsetIgnorePullRequestUpdates();
});
it('should stale the pull request', async () => {
expect.assertions(3);
await sut.test();
expect(sut.processor.staleIssues).toHaveLength(1);
expect(sut.processor.closedIssues).toHaveLength(0);
expect(sut.processor.removedLabelIssues).toHaveLength(0);
});
});
});
});
});
class SUT {
processor!: IssuesProcessorMock;
private _opts: IIssuesProcessorOptions = {...DefaultProcessorOptions};
private _isPullRequest = false;
private _createdAt: IsoDateString = '2020-01-01T17:00:00Z';
private _updatedAt: IsoDateString = '2020-01-01T17:00:00Z';
private _testIssueList: Issue[] = [];
toIssue(): SUT {
this._isPullRequest = false;
return this;
}
toPullRequest(): SUT {
this._isPullRequest = true;
return this;
}
staleIn(days: number): SUT {
this._updateOptions({
daysBeforeIssueStale: days,
daysBeforePrStale: days
});
return this;
}
created(daysAgo: number): SUT {
const today = new Date();
today.setDate(today.getDate() - daysAgo);
this._createdAt = today.toISOString();
return this;
}
updated(daysAgo: number): SUT {
const today = new Date();
today.setDate(today.getDate() - daysAgo);
this._updatedAt = today.toISOString();
return this;
}
ignoreUpdates(): SUT {
this._updateOptions({
ignoreUpdates: true
});
return this;
}
staleOnUpdates(): SUT {
this._updateOptions({
ignoreUpdates: false
});
return this;
}
ignoreIssueUpdates(): SUT {
this._updateOptions({
ignoreIssueUpdates: true
});
return this;
}
staleOnIssueUpdates(): SUT {
this._updateOptions({
ignoreIssueUpdates: false
});
return this;
}
unsetIgnoreIssueUpdates(): SUT {
this._updateOptions({
ignoreIssueUpdates: undefined
});
return this;
}
ignorePullRequestUpdates(): SUT {
this._updateOptions({
ignorePrUpdates: true
});
return this;
}
staleOnPullRequestUpdates(): SUT {
this._updateOptions({
ignorePrUpdates: false
});
return this;
}
unsetIgnorePullRequestUpdates(): SUT {
this._updateOptions({
ignorePrUpdates: undefined
});
return this;
}
async test(): Promise<number> {
return this._setTestIssueList()._setProcessor();
}
private _updateOptions(opts: Partial<IIssuesProcessorOptions>): SUT {
this._opts = {...this._opts, ...opts};
return this;
}
private _setTestIssueList(): SUT {
this._testIssueList = [
generateIssue(
this._opts,
1,
'My first issue',
this._updatedAt,
this._createdAt,
this._isPullRequest
)
];
return this;
}
private async _setProcessor(): Promise<number> {
this.processor = new IssuesProcessorMock(
this._opts,
async p => (p === 1 ? this._testIssueList : []),
async () => [],
async () => new Date().toDateString()
);
return this.processor.processIssues(1);
}
}

View File

@@ -4,58 +4,211 @@ author: 'GitHub'
inputs:
repo-token:
description: 'Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`.'
required: true
required: false
default: ${{ github.token }}
stale-issue-message:
description: 'The message to post on the issue when tagging it. If none provided, will not mark issues stale.'
required: false
stale-pr-message:
description: 'The message to post on the pr when tagging it. If none provided, will not mark pull requests stale.'
description: 'The message to post on the pull request when tagging it. If none provided, will not mark pull requests stale.'
required: false
close-issue-message:
description: 'The message to post on the issue when closing it. If none provided, will not comment when closing an issue.'
required: false
close-pr-message:
description: 'The message to post on the pr when closing it. If none provided, will not comment when closing a pull requests.'
description: 'The message to post on the pull request when closing it. If none provided, will not comment when closing a pull requests.'
required: false
days-before-stale:
description: 'The number of days old an issue can be before marking it stale. Set to -1 to never mark issues or pull requests as stale automatically.'
default: 60
description: 'The number of days old an issue or a pull request can be before marking it stale. Set to -1 to never mark issues or pull requests as stale automatically.'
required: false
default: '60'
days-before-issue-stale:
description: 'The number of days old an issue can be before marking it stale. Set to -1 to never mark issues as stale automatically. Override "days-before-stale" option regarding only the issues.'
required: false
days-before-pr-stale:
description: 'The number of days old a pull request can be before marking it stale. Set to -1 to never mark pull requests as stale automatically. Override "days-before-stale" option regarding only the pull requests.'
required: false
days-before-close:
description: 'The number of days to wait to close an issue or pull request after it being marked stale. Set to -1 to never close stale issues.'
default: 7
description: 'The number of days to wait to close an issue or a pull request after it being marked stale. Set to -1 to never close stale issues or pull requests.'
required: false
default: '7'
days-before-issue-close:
description: 'The number of days to wait to close an issue after it being marked stale. Set to -1 to never close stale issues. Override "days-before-close" option regarding only the issues.'
required: false
days-before-pr-close:
description: 'The number of days to wait to close a pull request after it being marked stale. Set to -1 to never close stale pull requests. Override "days-before-close" option regarding only the pull requests.'
required: false
stale-issue-label:
description: 'The label to apply when an issue is stale.'
required: false
default: 'Stale'
close-issue-label:
description: 'The label to apply when an issue is closed.'
required: false
exempt-issue-labels:
description: 'The labels to apply when an issue is exempt from being marked stale. Separate multiple labels with commas (eg. "label1,label2")'
description: 'The labels that mean an issue is exempt from being marked stale. Separate multiple labels with commas (eg. "label1,label2").'
default: ''
required: false
close-issue-reason:
description: 'The reason to use when closing an issue.'
default: 'not_planned'
required: false
stale-pr-label:
description: 'The label to apply when a pull request is stale.'
default: 'Stale'
required: false
close-pr-label:
description: 'The label to apply when a pull request is closed.'
required: false
exempt-pr-labels:
description: 'The labels to apply when a pull request is exempt from being marked stale. Separate multiple labels with commas (eg. "label1,label2")'
description: 'The labels that mean a pull request is exempt from being marked as stale. Separate multiple labels with commas (eg. "label1,label2").'
default: ''
required: false
exempt-milestones:
description: 'The milestones that mean an issue or a pull request is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2").'
default: ''
required: false
exempt-issue-milestones:
description: 'The milestones that mean an issue is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2"). Override "exempt-milestones" option regarding only the issues.'
default: ''
required: false
exempt-pr-milestones:
description: 'The milestones that mean a pull request is exempt from being marked as stale. Separate multiple milestones with commas (eg. "milestone1,milestone2"). Override "exempt-milestones" option regarding only the pull requests.'
default: ''
required: false
exempt-all-milestones:
description: 'Exempt all issues and pull requests with milestones from being marked as stale. Default to false.'
default: 'false'
required: false
exempt-all-issue-milestones:
description: 'Exempt all issues with milestones from being marked as stale. Override "exempt-all-milestones" option regarding only the issues.'
default: ''
required: false
exempt-all-pr-milestones:
description: 'Exempt all pull requests with milestones from being marked as stale. Override "exempt-all-milestones" option regarding only the pull requests.'
default: ''
required: false
only-labels:
description: 'Only issues or pull requests with all of these labels are checked if stale. Defaults to `[]` (disabled) and can be a comma-separated list of labels.'
description: 'Only issues or pull requests with all of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels.'
default: ''
required: false
any-of-labels:
description: 'Only issues or pull requests with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels.'
default: ''
required: false
any-of-issue-labels:
description: 'Only issues with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels. Override "any-of-labels" option regarding only the issues.'
default: ''
required: false
any-of-pr-labels:
description: 'Only pull requests with at least one of these labels are checked if stale. Defaults to `` (disabled) and can be a comma-separated list of labels. Override "any-of-labels" option regarding only the pull requests.'
default: ''
required: false
only-issue-labels:
description: 'Only issues with all of these labels are checked if stale. Defaults to `[]` (disabled) and can be a comma-separated list of labels. Override "only-labels" option regarding only the issues.'
default: ''
required: false
only-pr-labels:
description: 'Only pull requests with all of these labels are checked if stale. Defaults to `[]` (disabled) and can be a comma-separated list of labels. Override "only-labels" option regarding only the pull requests.'
default: ''
required: false
operations-per-run:
description: 'The maximum number of operations per run, used to control rate limiting.'
default: 30
description: 'The maximum number of operations per run, used to control rate limiting (GitHub API CRUD related).'
default: '30'
required: false
remove-stale-when-updated:
description: 'Remove stale labels from issues when they are updated or commented on.'
default: true
description: 'Remove stale labels from issues and pull requests when they are updated or commented on.'
default: 'true'
required: false
remove-issue-stale-when-updated:
description: 'Remove stale labels from issues when they are updated or commented on. Override "remove-stale-when-updated" option regarding only the issues.'
default: ''
required: false
remove-pr-stale-when-updated:
description: 'Remove stale labels from pull requests when they are updated or commented on. Override "remove-stale-when-updated" option regarding only the pull requests.'
default: ''
required: false
debug-only:
description: 'Run the processor in debug mode without actually performing any operations on live issues.'
default: false
default: 'false'
required: false
ascending:
description: 'The order to get issues or pull requests. Defaults to false, which is descending'
default: false
skip-stale-pr-message:
description: 'Skip adding stale message when marking a pull request as stale.'
default: false
skip-stale-issue-message:
description: 'Skip adding stale message when marking an issue as stale.'
default: false
description: 'The order to get issues or pull requests. Defaults to false, which is descending.'
default: 'false'
required: false
delete-branch:
description: 'Delete the git branch after closing a stale pull request.'
default: 'false'
required: false
start-date:
description: 'The date used to skip the stale action on issue/pull request created before it (ISO 8601 or RFC 2822).'
default: ''
required: false
exempt-assignees:
description: 'The assignees which exempt an issue or a pull request from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2").'
default: ''
required: false
exempt-issue-assignees:
description: 'The assignees which exempt an issue from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2"). Override "exempt-assignees" option regarding only the issues.'
default: ''
required: false
exempt-pr-assignees:
description: 'The assignees which exempt a pull request from being marked as stale. Separate multiple assignees with commas (eg. "user1,user2"). Override "exempt-assignees" option regarding only the pull requests.'
default: ''
required: false
exempt-all-assignees:
description: 'Exempt all issues and pull requests with assignees from being marked as stale. Default to false.'
default: 'false'
required: false
exempt-all-issue-assignees:
description: 'Exempt all issues with assignees from being marked as stale. Override "exempt-all-assignees" option regarding only the issues.'
default: ''
required: false
exempt-all-pr-assignees:
description: 'Exempt all pull requests with assignees from being marked as stale. Override "exempt-all-assignees" option regarding only the pull requests.'
default: ''
required: false
exempt-draft-pr:
description: 'Exempt draft pull requests from being marked as stale. Default to false.'
default: 'false'
required: false
enable-statistics:
description: 'Display some statistics at the end regarding the stale workflow (only when the logs are enabled).'
default: 'true'
required: false
labels-to-add-when-unstale:
description: 'A comma delimited list of labels to add when an issue or pull request becomes unstale.'
default: ''
required: false
labels-to-remove-when-stale:
description: 'A comma delimited list of labels to remove when an issue or pull request becomes stale.'
default: ''
required: false
labels-to-remove-when-unstale:
description: 'A comma delimited list of labels to remove when an issue or pull request becomes unstale.'
default: ''
required: false
ignore-updates:
description: 'Any update (update/comment) can reset the stale idle time on the issues and pull requests.'
default: 'false'
required: false
ignore-issue-updates:
description: 'Any update (update/comment) can reset the stale idle time on the issues. Override "ignore-updates" option regarding only the issues.'
default: ''
required: false
ignore-pr-updates:
description: 'Any update (update/comment) can reset the stale idle time on the pull requests. Override "ignore-updates" option regarding only the pull requests.'
default: ''
required: false
include-only-assigned:
description: 'Only the issues or the pull requests with an assignee will be marked as stale automatically.'
default: 'false'
required: false
outputs:
closed-issues-prs:
description: 'List of all closed issues and pull requests.'
staled-issues-prs:
description: 'List of all staled issues and pull requests.'
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'

12217
dist/index.js vendored

File diff suppressed because one or more lines are too long

24733
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +1,25 @@
{
"name": "stale-action",
"version": "2.0.0",
"version": "7.0.0",
"private": true,
"description": "Marks old issues and PRs as stale",
"main": "lib/main.js",
"scripts": {
"build": "tsc",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts",
"lint:fix": "eslint src/**/*.ts --fix",
"pack": "ncc build",
"test": "jest",
"all": "npm run build && npm run format && npm run lint && npm run pack && npm test"
"build": "tsc --project tsconfig.app.json && ncc build",
"format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write **/*.{ts,yml,yaml}",
"format-check": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --check **/*.{ts,yml,yaml}",
"lint": "eslint --config ./.eslintrc.js **/*.ts",
"lint:fix": "eslint --config ./.eslintrc.js **/*.ts --fix",
"lint:all": "npm run format-check && npm run lint",
"lint:all:fix": "npm run format && npm run lint:fix",
"test": "jest --config ./jest.config.js",
"test:only-errors": "jest --reporters jest-silent-reporter --silent",
"test:watch": "jest --watch --notify --expand",
"all": "npm run format && npm run lint && npm run build && npm test",
"all:ci": "npm run format && npm run lint && npm run build && npm run test:only-errors",
"prerelease": "npm run build",
"release": "standard-version",
"release:dry-run": "standard-version --dry-run"
},
"repository": {
"type": "git",
@@ -23,30 +30,40 @@
"node",
"stale"
],
"engines": {
"node": "16",
"npm": ">=7.0.0 <10.0.0-0"
},
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/github": "^4.0.0",
"@octokit/rest": "^18.0.9",
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
"@octokit/core": "^4.2.0",
"@octokit/plugin-retry": "^4.1.1",
"lodash.deburr": "^4.1.0",
"semver": "^7.3.2"
"semver": "^7.3.5"
},
"devDependencies": {
"@types/jest": "^26.0.15",
"@types/jest": "^29.5.0",
"@types/lodash.deburr": "^4.1.6",
"@types/node": "^14.10.0",
"@types/semver": "^7.3.4",
"@typescript-eslint/parser": "^4.8.1",
"@vercel/ncc": "^0.24.0",
"eslint": "^7.7.0",
"eslint-plugin-github": "^4.0.1",
"eslint-plugin-jest": "^24.1.3",
"jest": "^24.9.0",
"jest-circus": "^26.4.2",
"js-yaml": "^3.14.0",
"prettier": "^2.1.1",
"ts-jest": "^24.2.0",
"typescript": "^4.0.2"
"@types/node": "^18.15.3",
"@types/semver": "^7.3.5",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"@vercel/ncc": "^0.36.1",
"ansi-styles": "5.2.0",
"eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-jest": "^27.2.1",
"jest": "^29.5.0",
"jest-circus": "^29.3.1",
"jest-silent-reporter": "^0.5.0",
"js-yaml": "^4.1.0",
"prettier": "^2.8.6",
"standard-version": "^9.3.1",
"terminal-link": "^2.1.1",
"ts-jest": "^29.0.5",
"typescript": "^5.0.2"
}
}

View File

@@ -1,498 +0,0 @@
import * as core from '@actions/core';
import {context, getOctokit} from '@actions/github';
import {GetResponseTypeFromEndpointMethod} from '@octokit/types';
import {isLabeled} from './functions/is-labeled';
import {labelsToList} from './functions/labels-to-list';
export interface Issue {
title: string;
number: number;
updated_at: string;
labels: Label[];
pull_request: any;
state: string;
locked: boolean;
}
export interface User {
type: string;
login: string;
}
export interface Comment {
user: User;
}
export interface IssueEvent {
created_at: string;
event: string;
label: Label;
}
export interface Label {
name: string;
}
export interface IssueProcessorOptions {
repoToken: string;
staleIssueMessage: string;
stalePrMessage: string;
closeIssueMessage: string;
closePrMessage: string;
daysBeforeStale: number;
daysBeforeClose: number;
staleIssueLabel: string;
closeIssueLabel: string;
exemptIssueLabels: string;
stalePrLabel: string;
closePrLabel: string;
exemptPrLabels: string;
onlyLabels: string;
operationsPerRun: number;
removeStaleWhenUpdated: boolean;
debugOnly: boolean;
ascending: boolean;
skipStaleIssueMessage: boolean;
skipStalePrMessage: boolean;
}
/***
* Handle processing of issues for staleness/closure.
*/
export class IssueProcessor {
readonly client: any; // need to make this the correct type
readonly options: IssueProcessorOptions;
private operationsLeft = 0;
readonly staleIssues: Issue[] = [];
readonly closedIssues: Issue[] = [];
readonly removedLabelIssues: Issue[] = [];
constructor(
options: IssueProcessorOptions,
getIssues?: (page: number) => Promise<Issue[]>,
listIssueComments?: (
issueNumber: number,
sinceDate: string
) => Promise<Comment[]>,
getLabelCreationDate?: (
issue: Issue,
label: string
) => Promise<string | undefined>
) {
this.options = options;
this.operationsLeft = options.operationsPerRun;
this.client = getOctokit(options.repoToken);
if (getIssues) {
this.getIssues = getIssues;
}
if (listIssueComments) {
this.listIssueComments = listIssueComments;
}
if (getLabelCreationDate) {
this.getLabelCreationDate = getLabelCreationDate;
}
if (this.options.debugOnly) {
core.warning(
'Executing in debug mode. Debug output will be written but no issues will be processed.'
);
}
}
async processIssues(page = 1): Promise<number> {
// get the next batch of issues
const issues: Issue[] = await this.getIssues(page);
this.operationsLeft -= 1;
if (issues.length <= 0) {
core.info('No more issues found to process. Exiting.');
return this.operationsLeft;
}
for (const issue of issues.values()) {
const isPr = !!issue.pull_request;
core.info(
`Found issue: issue #${issue.number} last updated ${issue.updated_at} (is pr? ${isPr})`
);
// calculate string based messages for this issue
const staleMessage: string = isPr
? this.options.stalePrMessage
: this.options.staleIssueMessage;
const closeMessage: string = isPr
? this.options.closePrMessage
: this.options.closeIssueMessage;
const staleLabel: string = isPr
? this.options.stalePrLabel
: this.options.staleIssueLabel;
const closeLabel: string = isPr
? this.options.closePrLabel
: this.options.closeIssueLabel;
const exemptLabels: string[] = labelsToList(
isPr ? this.options.exemptPrLabels : this.options.exemptIssueLabels
);
const skipMessage = isPr
? this.options.skipStalePrMessage
: this.options.skipStaleIssueMessage;
const issueType: string = isPr ? 'pr' : 'issue';
const shouldMarkWhenStale = this.options.daysBeforeStale > -1;
if (!staleMessage && shouldMarkWhenStale) {
core.info(`Skipping ${issueType} due to empty stale message`);
continue;
}
if (issue.state === 'closed') {
core.info(`Skipping ${issueType} because it is closed`);
continue; // don't process closed issues
}
if (issue.locked) {
core.info(`Skipping ${issueType} because it is locked`);
continue; // don't process locked issues
}
if (
exemptLabels.some((exemptLabel: string) =>
isLabeled(issue, exemptLabel)
)
) {
core.info(`Skipping ${issueType} because it has an exempt label`);
continue; // don't process exempt issues
}
// does this issue have a stale label?
let isStale = isLabeled(issue, staleLabel);
// should this issue be marked stale?
const shouldBeStale = !IssueProcessor.updatedSince(
issue.updated_at,
this.options.daysBeforeStale
);
// determine if this issue needs to be marked stale first
if (!isStale && shouldBeStale && shouldMarkWhenStale) {
core.info(
`Marking ${issueType} stale because it was last updated on ${issue.updated_at} and it does not have a stale label`
);
await this.markStale(issue, staleMessage, staleLabel, skipMessage);
isStale = true; // this issue is now considered stale
}
// process the issue if it was marked stale
if (isStale) {
core.info(`Found a stale ${issueType}`);
await this.processStaleIssue(
issue,
issueType,
staleLabel,
closeMessage,
closeLabel
);
}
}
if (this.operationsLeft <= 0) {
core.warning('Reached max number of operations to process. Exiting.');
return 0;
}
// do the next batch
return this.processIssues(page + 1);
}
// handle all of the stale issue logic when we find a stale issue
private async processStaleIssue(
issue: Issue,
issueType: string,
staleLabel: string,
closeMessage?: string,
closeLabel?: string
) {
const markedStaleOn: string =
(await this.getLabelCreationDate(issue, staleLabel)) || issue.updated_at;
core.info(`Issue #${issue.number} marked stale on: ${markedStaleOn}`);
const issueHasComments: boolean = await this.hasCommentsSince(
issue,
markedStaleOn
);
core.info(
`Issue #${issue.number} has been commented on: ${issueHasComments}`
);
const issueHasUpdate: boolean = IssueProcessor.updatedSince(
issue.updated_at,
this.options.daysBeforeClose
);
core.info(`Issue #${issue.number} has been updated: ${issueHasUpdate}`);
// should we un-stale this issue?
if (this.options.removeStaleWhenUpdated && issueHasComments) {
core.info(
`Issue #${issue.number} is no longer stale. Removing stale label.`
);
await this.removeLabel(issue, staleLabel);
}
// now start closing logic
if (this.options.daysBeforeClose < 0) {
return; // nothing to do because we aren't closing stale issues
}
if (!issueHasComments && !issueHasUpdate) {
core.info(
`Closing ${issueType} because it was last updated on ${issue.updated_at}`
);
await this.closeIssue(issue, closeMessage, closeLabel);
} else {
core.info(
`Stale ${issueType} is not old enough to close yet (hasComments? ${issueHasComments}, hasUpdate? ${issueHasUpdate})`
);
}
}
// checks to see if a given issue is still stale (has had activity on it)
private async hasCommentsSince(
issue: Issue,
sinceDate: string
): Promise<boolean> {
core.info(
`Checking for comments on issue #${issue.number} since ${sinceDate}`
);
if (!sinceDate) {
return true;
}
// find any comments since the date
const comments = await this.listIssueComments(issue.number, sinceDate);
const filteredComments = comments.filter(
comment =>
comment.user.type === 'User' && comment.user.login !== context.actor
);
core.info(
`Comments not made by actor or another bot: ${filteredComments.length}`
);
// if there are any user comments returned
return filteredComments.length > 0;
}
// grab comments for an issue since a given date
private async listIssueComments(
issueNumber: number,
sinceDate: string
): Promise<Comment[]> {
// find any comments since date on the given issue
try {
const comments = await this.client.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
since: sinceDate
});
return comments.data;
} catch (error) {
core.error(`List issue comments error: ${error.message}`);
return Promise.resolve([]);
}
}
// grab issues from github in baches of 100
private async getIssues(page: number): Promise<Issue[]> {
// generate type for response
const endpoint = this.client.issues.listForRepo;
type OctoKitIssueList = GetResponseTypeFromEndpointMethod<typeof endpoint>;
try {
const issueResult: OctoKitIssueList = await this.client.issues.listForRepo(
{
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
labels: this.options.onlyLabels,
per_page: 100,
direction: this.options.ascending ? 'asc' : 'desc',
page
}
);
return issueResult.data;
} catch (error) {
core.error(`Get issues for repo error: ${error.message}`);
return Promise.resolve([]);
}
}
// Mark an issue as stale with a comment and a label
private async markStale(
issue: Issue,
staleMessage: string,
staleLabel: string,
skipMessage: boolean
): Promise<void> {
core.info(`Marking issue #${issue.number} as stale`);
this.staleIssues.push(issue);
this.operationsLeft -= 2;
// if the issue is being marked stale, the updated date should be changed to right now
// so that close calculations work correctly
const newUpdatedAtDate: Date = new Date();
issue.updated_at = newUpdatedAtDate.toString();
if (this.options.debugOnly) {
return;
}
if (!skipMessage) {
try {
await this.client.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: staleMessage
});
} catch (error) {
core.error(`Error creating a comment: ${error.message}`);
}
}
try {
await this.client.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
labels: [staleLabel]
});
} catch (error) {
core.error(`Error adding a label: ${error.message}`);
}
}
// Close an issue based on staleness
private async closeIssue(
issue: Issue,
closeMessage?: string,
closeLabel?: string
): Promise<void> {
core.info(`Closing issue #${issue.number} for being stale`);
this.closedIssues.push(issue);
this.operationsLeft -= 1;
if (this.options.debugOnly) {
return;
}
if (closeMessage) {
try {
await this.client.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: closeMessage
});
} catch (error) {
core.error(`Error creating a comment: ${error.message}`);
}
}
if (closeLabel) {
try {
await this.client.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
labels: [closeLabel]
});
} catch (error) {
core.error(`Error adding a label: ${error.message}`);
}
}
try {
await this.client.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
state: 'closed'
});
} catch (error) {
core.error(`Error updating an issue: ${error.message}`);
}
}
// Remove a label from an issue
private async removeLabel(issue: Issue, label: string): Promise<void> {
core.info(`Removing label from issue #${issue.number}`);
this.removedLabelIssues.push(issue);
this.operationsLeft -= 1;
if (this.options.debugOnly) {
return;
}
try {
await this.client.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
name: encodeURIComponent(label) // A label can have a "?" in the name
});
} catch (error) {
core.error(`Error removing a label: ${error.message}`);
}
}
// returns the creation date of a given label on an issue (or nothing if no label existed)
///see https://developer.github.com/v3/activity/events/
private async getLabelCreationDate(
issue: Issue,
label: string
): Promise<string | undefined> {
core.info(`Checking for label on issue #${issue.number}`);
this.operationsLeft -= 1;
const options = this.client.issues.listEvents.endpoint.merge({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 100,
issue_number: issue.number
});
const events: IssueEvent[] = await this.client.paginate(options);
const reversedEvents = events.reverse();
const staleLabeledEvent = reversedEvents.find(
event => event.event === 'labeled' && event.label.name === label
);
if (!staleLabeledEvent) {
// Must be old rather than labeled
return undefined;
}
return staleLabeledEvent.created_at;
}
private static updatedSince(timestamp: string, num_days: number): boolean {
const daysInMillis = 1000 * 60 * 60 * 24 * num_days;
const millisSinceLastUpdated =
new Date().getTime() - new Date(timestamp).getTime();
return millisSinceLastUpdated <= daysInMillis;
}
}

View File

@@ -0,0 +1,873 @@
import {DefaultProcessorOptions} from '../../__tests__/constants/default-processor-options';
import {generateIIssue} from '../../__tests__/functions/generate-iissue';
import {IIssue} from '../interfaces/issue';
import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options';
import {Assignees} from './assignees';
import {Issue} from './issue';
describe('Assignees', (): void => {
let assignees: Assignees;
let optionsInterface: IIssuesProcessorOptions;
let issue: Issue;
let issueInterface: IIssue;
beforeEach((): void => {
optionsInterface = {
...DefaultProcessorOptions,
exemptAllAssignees: false
};
issueInterface = generateIIssue();
});
describe('shouldExemptAssignees()', (): void => {
describe('when the given issue is not a pull request', (): void => {
beforeEach((): void => {
issueInterface.pull_request = undefined;
});
describe('when the given options are not configured to exempt an assignee', (): void => {
beforeEach((): void => {
optionsInterface.exemptAssignees = '';
});
describe('when the given options are not configured to exempt an issue with an assignee', (): void => {
beforeEach((): void => {
optionsInterface.exemptIssueAssignees = '';
});
describe('when the given issue does not have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-login',
type: 'User'
}
];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
});
describe('when the given options are configured to exempt an issue with an assignee', (): void => {
beforeEach((): void => {
optionsInterface.exemptIssueAssignees =
'dummy-exempt-issue-assignee';
});
describe('when the given issue does not have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have an assignee different than the exempt issue assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-login',
type: 'User'
}
];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have an assignee equaling the exempt issue assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-exempt-issue-assignee',
type: 'User'
}
];
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(true);
});
});
});
});
describe('when the given options are configured to exempt an assignee', (): void => {
beforeEach((): void => {
optionsInterface.exemptAssignees = 'dummy-exempt-assignee';
});
describe('when the given options are not configured to exempt an issue with an assignee', (): void => {
beforeEach((): void => {
optionsInterface.exemptIssueAssignees = '';
});
describe('when the given issue does not have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have an assignee different than the exempt assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-login',
type: 'User'
}
];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have an assignee equaling the exempt assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-exempt-assignee',
type: 'User'
}
];
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(true);
});
});
});
describe('when the given options are configured to exempt an issue with an assignee', (): void => {
beforeEach((): void => {
optionsInterface.exemptIssueAssignees =
'dummy-exempt-issue-assignee';
});
describe('when the given issue does not have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have an assignee different than the exempt issue assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-login',
type: 'User'
}
];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have an assignee equaling the exempt issue assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-exempt-issue-assignee',
type: 'User'
}
];
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(true);
});
});
describe('when the given issue does have an assignee different than the exempt assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-login',
type: 'User'
}
];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have an assignee equaling the exempt assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-exempt-assignee',
type: 'User'
}
];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
});
});
describe('when the given options are configured to exempt all assignees', (): void => {
beforeEach((): void => {
optionsInterface.exemptAllAssignees = true;
});
describe('when the given issue does not have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-exempt-assignee',
type: 'User'
}
];
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(true);
});
});
describe('when the given options are not configured to exempt all issue assignees', (): void => {
beforeEach((): void => {
optionsInterface.exemptAllIssueAssignees = false;
});
describe('when the given issue does not have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-exempt-assignee',
type: 'User'
}
];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
});
describe('when the given options are configured to exempt all issue assignees', (): void => {
beforeEach((): void => {
optionsInterface.exemptAllIssueAssignees = true;
});
describe('when the given issue does not have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-exempt-issue-assignee',
type: 'User'
}
];
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(true);
});
});
});
});
});
describe('when the given issue is a pull request', (): void => {
beforeEach((): void => {
issueInterface.pull_request = {};
});
describe('when the given options are not configured to exempt an assignee', (): void => {
beforeEach((): void => {
optionsInterface.exemptAssignees = '';
});
describe('when the given options are not configured to exempt a pull request with an assignee', (): void => {
beforeEach((): void => {
optionsInterface.exemptPrAssignees = '';
});
describe('when the given pull request does not have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-login',
type: 'User'
}
];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
});
describe('when the given options are configured to exempt a pull request with an assignee', (): void => {
beforeEach((): void => {
optionsInterface.exemptPrAssignees = 'dummy-exempt-pr-assignee';
});
describe('when the given pull request does not have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have an assignee different than the exempt pull request assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-login',
type: 'User'
}
];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have an assignee equaling the exempt pull request assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-exempt-pr-assignee',
type: 'User'
}
];
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(true);
});
});
});
});
describe('when the given options are configured to exempt an assignee', (): void => {
beforeEach((): void => {
optionsInterface.exemptAssignees = 'dummy-exempt-assignee';
});
describe('when the given options are not configured to exempt a pull request with an assignee', (): void => {
beforeEach((): void => {
optionsInterface.exemptPrAssignees = '';
});
describe('when the given pull request does not have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have an assignee different than the exempt assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-login',
type: 'User'
}
];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have an assignee equaling the exempt assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-exempt-assignee',
type: 'User'
}
];
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(true);
});
});
});
describe('when the given options are configured to exempt a pull request with an assignee', (): void => {
beforeEach((): void => {
optionsInterface.exemptPrAssignees = 'dummy-exempt-pr-assignee';
});
describe('when the given pull request does not have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have an assignee different than the exempt pull request assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-login',
type: 'User'
}
];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have an assignee equaling the exempt pull request assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-exempt-pr-assignee',
type: 'User'
}
];
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(true);
});
});
describe('when the given pull request does have an assignee different than the exempt assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-login',
type: 'User'
}
];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have an assignee equaling the exempt assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-exempt-assignee',
type: 'User'
}
];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
});
});
describe('when the given options are configured to exempt all assignees', (): void => {
beforeEach((): void => {
optionsInterface.exemptAllAssignees = true;
});
describe('when the given pull request does not have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-exempt-assignee',
type: 'User'
}
];
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(true);
});
});
describe('when the given options are not configured to exempt all pull request assignees', (): void => {
beforeEach((): void => {
optionsInterface.exemptAllPrAssignees = false;
});
describe('when the given pull request does not have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-exempt-assignee',
type: 'User'
}
];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
});
describe('when the given options are configured to exempt all pull request assignees', (): void => {
beforeEach((): void => {
optionsInterface.exemptAllPrAssignees = true;
});
describe('when the given pull request does not have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have an assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-exempt-issue-assignee',
type: 'User'
}
];
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
assignees = new Assignees(optionsInterface, issue);
const result = assignees.shouldExemptAssignees();
expect(result).toStrictEqual(true);
});
});
});
});
});
});
});

290
src/classes/assignees.ts Normal file
View File

@@ -0,0 +1,290 @@
import deburr from 'lodash.deburr';
import {Option} from '../enums/option';
import {wordsToList} from '../functions/words-to-list';
import {Assignee} from '../interfaces/assignee';
import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options';
import {Issue} from './issue';
import {IssueLogger} from './loggers/issue-logger';
import {LoggerService} from '../services/logger.service';
type CleanAssignee = string;
export class Assignees {
private readonly _options: IIssuesProcessorOptions;
private readonly _issue: Issue;
private readonly _issueLogger: IssueLogger;
constructor(options: Readonly<IIssuesProcessorOptions>, issue: Issue) {
this._options = options;
this._issue = issue;
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');
this._logSkip();
return false;
}
if (this._shouldExemptAllAssignees()) {
this._issueLogger.info(
LoggerService.white('└──'),
'Skipping this $$type because it has an exempt assignee'
);
return true;
}
const exemptAssignees: string[] = this._getExemptAssignees();
if (exemptAssignees.length === 0) {
this._issueLogger.info(
LoggerService.white('├──'),
`No assignee option was specified to skip the stale process for this $$type`
);
this._logSkip();
return false;
}
this._issueLogger.info(
LoggerService.white('├──'),
`Found ${LoggerService.cyan(exemptAssignees.length)} assignee${
exemptAssignees.length > 1 ? 's' : ''
} that can exempt stale on this $$type`
);
const hasExemptAssignee: boolean = exemptAssignees.some(
(exemptAssignee: Readonly<string>): boolean =>
this._hasAssignee(exemptAssignee)
);
if (!hasExemptAssignee) {
this._issueLogger.info(
LoggerService.white('├──'),
'No assignee on this $$type can exempt the stale process'
);
this._logSkip();
} else {
this._issueLogger.info(
LoggerService.white('└──'),
'Skipping this $$type because it has an exempt assignee'
);
}
return hasExemptAssignee;
}
private _getExemptAssignees(): string[] {
return this._issue.isPullRequest
? this._getExemptPullRequestAssignees()
: this._getExemptIssueAssignees();
}
private _getExemptIssueAssignees(): string[] {
if (this._options.exemptIssueAssignees === '') {
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptIssueAssignees
)} is disabled. No specific assignee can skip the stale process for this $$type`
);
if (this._options.exemptAssignees === '') {
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAssignees
)} is disabled. No specific assignee can skip the stale process for this $$type`
);
return [];
}
const exemptAssignees: string[] = wordsToList(
this._options.exemptAssignees
);
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAssignees
)} is set. ${LoggerService.cyan(exemptAssignees.length)} assignee${
exemptAssignees.length === 1 ? '' : 's'
} can skip the stale process for this $$type`
);
return exemptAssignees;
}
const exemptAssignees: string[] = wordsToList(
this._options.exemptIssueAssignees
);
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptIssueAssignees
)} is set. ${LoggerService.cyan(exemptAssignees.length)} assignee${
exemptAssignees.length === 1 ? '' : 's'
} can skip the stale process for this $$type`
);
return exemptAssignees;
}
private _getExemptPullRequestAssignees(): string[] {
if (this._options.exemptPrAssignees === '') {
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptPrAssignees
)} is disabled. No specific assignee can skip the stale process for this $$type`
);
if (this._options.exemptAssignees === '') {
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAssignees
)} is disabled. No specific assignee can skip the stale process for this $$type`
);
return [];
}
const exemptAssignees: string[] = wordsToList(
this._options.exemptAssignees
);
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAssignees
)} is set. ${LoggerService.cyan(exemptAssignees.length)} assignee${
exemptAssignees.length === 1 ? '' : 's'
} can skip the stale process for this $$type`
);
return exemptAssignees;
}
const exemptAssignees: string[] = wordsToList(
this._options.exemptPrAssignees
);
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptPrAssignees
)} is set. ${LoggerService.cyan(exemptAssignees.length)} assignee${
exemptAssignees.length === 1 ? '' : 's'
} can skip the stale process for this $$type`
);
return exemptAssignees;
}
private _hasAssignee(assignee: Readonly<string>): boolean {
const cleanAssignee: CleanAssignee = Assignees._cleanAssignee(assignee);
return this._issue.assignees.some(
(issueAssignee: Readonly<Assignee>): boolean => {
const isSameAssignee: boolean =
cleanAssignee === Assignees._cleanAssignee(issueAssignee.login);
if (isSameAssignee) {
this._issueLogger.info(
LoggerService.white('├──'),
`@${issueAssignee.login} is assigned on this $$type and is an exempt assignee`
);
}
return isSameAssignee;
}
);
}
private _shouldExemptAllAssignees(): boolean {
return this._issue.isPullRequest
? this._shouldExemptAllPullRequestAssignees()
: this._shouldExemptAllIssueAssignees();
}
private _shouldExemptAllIssueAssignees(): boolean {
if (this._options.exemptAllIssueAssignees === true) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAllIssueAssignees
)} is enabled. Any assignee on this $$type will skip the stale process`
);
return true;
} else if (this._options.exemptAllIssueAssignees === false) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAllIssueAssignees
)} is disabled. Only some specific assignees on this $$type will skip the stale process`
);
return false;
}
this._logExemptAllAssigneesOption();
return this._options.exemptAllAssignees;
}
private _shouldExemptAllPullRequestAssignees(): boolean {
if (this._options.exemptAllPrAssignees === true) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAllPrAssignees
)} is enabled. Any assignee on this $$type will skip the stale process`
);
return true;
} else if (this._options.exemptAllPrAssignees === false) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAllPrAssignees
)} is disabled. Only some specific assignees on this $$type will skip the stale process`
);
return false;
}
this._logExemptAllAssigneesOption();
return this._options.exemptAllAssignees;
}
private _logExemptAllAssigneesOption(): void {
if (this._options.exemptAllAssignees) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAllAssignees
)} is enabled. Any assignee on this $$type will skip the stale process`
);
} else {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAllAssignees
)} is disabled. Only some specific assignees on this $$type will skip the stale process`
);
}
}
private _logSkip(): void {
this._issueLogger.info(
LoggerService.white('└──'),
'Skip the assignees checks'
);
}
}

View File

@@ -0,0 +1,51 @@
import {Option} from '../enums/option';
import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options';
import {IPullRequest} from '../interfaces/pull-request';
import {LoggerService} from '../services/logger.service';
import {Issue} from './issue';
import {IssueLogger} from './loggers/issue-logger';
export class ExemptDraftPullRequest {
private readonly _options: IIssuesProcessorOptions;
private readonly _issue: Issue;
private readonly _issueLogger: IssueLogger;
constructor(options: Readonly<IIssuesProcessorOptions>, issue: Issue) {
this._options = options;
this._issue = issue;
this._issueLogger = new IssueLogger(issue);
}
async shouldExemptDraftPullRequest(
pullRequestCallback: () => Promise<IPullRequest | undefined | void>
): Promise<boolean> {
if (this._issue.isPullRequest) {
if (this._options.exemptDraftPr) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.ExemptDraftPr
)} is enabled`
);
const pullRequest: IPullRequest | undefined | void =
await pullRequestCallback();
if (pullRequest?.draft === true) {
this._issueLogger.info(
LoggerService.white('└──'),
`Skip the $$type draft checks`
);
return true;
} else {
this._issueLogger.info(
LoggerService.white('└──'),
`Continuing the process for this $$type because it is not a draft`
);
}
}
}
return false;
}
}

View File

@@ -0,0 +1,252 @@
/* eslint jest/no-identical-title: "off" */
import {DefaultProcessorOptions} from '../../__tests__/constants/default-processor-options';
import {generateIIssue} from '../../__tests__/functions/generate-iissue';
import {IIssue} from '../interfaces/issue';
import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options';
import {IgnoreUpdates} from './ignore-updates';
import {Issue} from './issue';
describe('IgnoreUpdates', (): void => {
let ignoreUpdates: IgnoreUpdates;
let optionsInterface: IIssuesProcessorOptions;
let issue: Issue;
let issueInterface: IIssue;
beforeEach((): void => {
optionsInterface = {
...DefaultProcessorOptions,
ignoreIssueUpdates: true
};
issueInterface = generateIIssue();
});
describe('shouldIgnoreUpdates()', (): void => {
describe('when the given issue is not a pull request', (): void => {
beforeEach((): void => {
issueInterface.pull_request = undefined;
});
describe('when the given options are configured to reset the stale on updates', (): void => {
beforeEach((): void => {
optionsInterface.ignoreUpdates = false;
});
describe('when the given options are not configured to reset the issue stale on updates', (): void => {
beforeEach((): void => {
delete optionsInterface.ignoreIssueUpdates;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
const result = ignoreUpdates.shouldIgnoreUpdates();
expect(result).toStrictEqual(false);
});
});
describe('when the given options are configured to reset the issue stale on updates', (): void => {
beforeEach((): void => {
optionsInterface.ignoreIssueUpdates = false;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
const result = ignoreUpdates.shouldIgnoreUpdates();
expect(result).toStrictEqual(false);
});
});
describe('when the given options are configured to not reset the issue stale on updates', (): void => {
beforeEach((): void => {
optionsInterface.ignoreIssueUpdates = true;
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
const result = ignoreUpdates.shouldIgnoreUpdates();
expect(result).toStrictEqual(true);
});
});
});
describe('when the given options are configured to reset the stale on updates', (): void => {
beforeEach((): void => {
optionsInterface.ignoreUpdates = true;
});
describe('when the given options are not configured to reset the issue stale on updates', (): void => {
beforeEach((): void => {
delete optionsInterface.ignoreIssueUpdates;
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
const result = ignoreUpdates.shouldIgnoreUpdates();
expect(result).toStrictEqual(true);
});
});
describe('when the given options are configured to reset the issue stale on updates', (): void => {
beforeEach((): void => {
optionsInterface.ignoreIssueUpdates = false;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
const result = ignoreUpdates.shouldIgnoreUpdates();
expect(result).toStrictEqual(false);
});
});
describe('when the given options are configured to not reset the issue stale on updates', (): void => {
beforeEach((): void => {
optionsInterface.ignoreIssueUpdates = true;
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
const result = ignoreUpdates.shouldIgnoreUpdates();
expect(result).toStrictEqual(true);
});
});
});
});
describe('when the given issue is a pull request', (): void => {
beforeEach((): void => {
issueInterface.pull_request = {};
});
describe('when the given options are configured to reset the stale on updates', (): void => {
beforeEach((): void => {
optionsInterface.ignoreUpdates = false;
});
describe('when the given options are not configured to reset the pull request stale on updates', (): void => {
beforeEach((): void => {
delete optionsInterface.ignorePrUpdates;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
const result = ignoreUpdates.shouldIgnoreUpdates();
expect(result).toStrictEqual(false);
});
});
describe('when the given options are configured to reset the pull request stale on updates', (): void => {
beforeEach((): void => {
optionsInterface.ignorePrUpdates = false;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
const result = ignoreUpdates.shouldIgnoreUpdates();
expect(result).toStrictEqual(false);
});
});
describe('when the given options are configured to not reset the pull request stale on updates', (): void => {
beforeEach((): void => {
optionsInterface.ignorePrUpdates = true;
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
const result = ignoreUpdates.shouldIgnoreUpdates();
expect(result).toStrictEqual(true);
});
});
});
describe('when the given options are configured to not reset the stale on updates', (): void => {
beforeEach((): void => {
optionsInterface.ignoreUpdates = true;
});
describe('when the given options are not configured to reset the pull request stale on updates', (): void => {
beforeEach((): void => {
delete optionsInterface.ignorePrUpdates;
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
const result = ignoreUpdates.shouldIgnoreUpdates();
expect(result).toStrictEqual(true);
});
});
describe('when the given options are configured to reset the pull request stale on updates', (): void => {
beforeEach((): void => {
optionsInterface.ignorePrUpdates = false;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
const result = ignoreUpdates.shouldIgnoreUpdates();
expect(result).toStrictEqual(false);
});
});
describe('when the given options are configured to not reset the pull request stale on updates', (): void => {
beforeEach((): void => {
optionsInterface.ignorePrUpdates = true;
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
ignoreUpdates = new IgnoreUpdates(optionsInterface, issue);
const result = ignoreUpdates.shouldIgnoreUpdates();
expect(result).toStrictEqual(true);
});
});
});
});
});
});

View File

@@ -0,0 +1,90 @@
import {Option} from '../enums/option';
import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options';
import {Issue} from './issue';
import {IssueLogger} from './loggers/issue-logger';
export class IgnoreUpdates {
private readonly _options: IIssuesProcessorOptions;
private readonly _issue: Issue;
private readonly _issueLogger: IssueLogger;
constructor(options: Readonly<IIssuesProcessorOptions>, issue: Issue) {
this._options = options;
this._issue = issue;
this._issueLogger = new IssueLogger(issue);
}
shouldIgnoreUpdates(): boolean {
return this._shouldIgnoreUpdates();
}
private _shouldIgnoreUpdates(): boolean {
return this._issue.isPullRequest
? this._shouldIgnorePullRequestUpdates()
: this._shouldIgnoreIssueUpdates();
}
private _shouldIgnorePullRequestUpdates(): boolean {
if (this._options.ignorePrUpdates === true) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.IgnorePrUpdates
)} is enabled. The stale counter will ignore any updates or comments on this $$type and will use the creation date as a reference ignoring any kind of update`
);
return true;
} else if (this._options.ignorePrUpdates === false) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.IgnorePrUpdates
)} is disabled. The stale counter will take into account updates and comments on this $$type to avoid to stale when there is some update`
);
return false;
}
this._logIgnoreUpdates();
return this._options.ignoreUpdates;
}
private _shouldIgnoreIssueUpdates(): boolean {
if (this._options.ignoreIssueUpdates === true) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.IgnoreIssueUpdates
)} is enabled. The stale counter will ignore any updates or comments on this $$type and will use the creation date as a reference ignoring any kind of update`
);
return true;
} else if (this._options.ignoreIssueUpdates === false) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.IgnoreIssueUpdates
)} is disabled. The stale counter will take into account updates and comments on this $$type to avoid to stale when there is some update`
);
return false;
}
this._logIgnoreUpdates();
return this._options.ignoreUpdates;
}
private _logIgnoreUpdates(): void {
if (this._options.ignoreUpdates) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.IgnoreUpdates
)} is enabled. The stale counter will ignore any updates or comments on this $$type and will use the creation date as a reference ignoring any kind of update`
);
} else {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.IgnoreUpdates
)} is disabled. The stale counter will take into account updates and comments on this $$type to avoid to stale when there is some update`
);
}
}
}

300
src/classes/issue.spec.ts Normal file
View File

@@ -0,0 +1,300 @@
import {IUserAssignee} from '../interfaces/assignee';
import {IIssue} from '../interfaces/issue';
import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options';
import {ILabel} from '../interfaces/label';
import {IMilestone} from '../interfaces/milestone';
import {Issue} from './issue';
describe('Issue', (): void => {
let issue: Issue;
let optionsInterface: IIssuesProcessorOptions;
let issueInterface: IIssue;
beforeEach((): void => {
optionsInterface = {
ascending: false,
closeIssueLabel: '',
closeIssueMessage: '',
closePrLabel: '',
closePrMessage: '',
daysBeforeClose: 0,
daysBeforeIssueClose: 0,
daysBeforeIssueStale: 0,
daysBeforePrClose: 0,
daysBeforePrStale: 0,
daysBeforeStale: 0,
debugOnly: false,
deleteBranch: false,
exemptIssueLabels: '',
exemptPrLabels: '',
onlyLabels: '',
onlyIssueLabels: '',
onlyPrLabels: '',
anyOfLabels: '',
anyOfIssueLabels: '',
anyOfPrLabels: '',
operationsPerRun: 0,
removeStaleWhenUpdated: false,
removeIssueStaleWhenUpdated: undefined,
removePrStaleWhenUpdated: undefined,
repoToken: '',
staleIssueMessage: '',
stalePrMessage: '',
startDate: undefined,
stalePrLabel: 'dummy-stale-pr-label',
staleIssueLabel: 'dummy-stale-issue-label',
exemptMilestones: '',
exemptIssueMilestones: '',
exemptPrMilestones: '',
exemptAllMilestones: false,
exemptAllIssueMilestones: undefined,
exemptAllPrMilestones: undefined,
exemptAssignees: '',
exemptIssueAssignees: '',
exemptPrAssignees: '',
exemptAllAssignees: false,
exemptAllIssueAssignees: undefined,
exemptAllPrAssignees: undefined,
enableStatistics: false,
labelsToRemoveWhenStale: '',
labelsToRemoveWhenUnstale: '',
labelsToAddWhenUnstale: '',
ignoreUpdates: false,
ignoreIssueUpdates: undefined,
ignorePrUpdates: undefined,
exemptDraftPr: false,
closeIssueReason: '',
includeOnlyAssigned: false
};
issueInterface = {
title: 'dummy-title',
number: 8,
created_at: 'dummy-created-at',
updated_at: 'dummy-updated-at',
labels: [
{
name: 'dummy-name'
}
],
pull_request: {},
state: 'dummy-state',
locked: false,
milestone: {
title: 'dummy-milestone'
},
assignees: [
{
login: 'dummy-login',
type: 'User'
}
]
};
issue = new Issue(optionsInterface, issueInterface);
});
describe('constructor()', (): void => {
it('should set the title with the given issue title', (): void => {
expect.assertions(1);
expect(issue.title).toStrictEqual('dummy-title');
});
it('should set the number with the given issue number', (): void => {
expect.assertions(1);
expect(issue.number).toStrictEqual(8);
});
it('should set the created_at with the given issue created_at', (): void => {
expect.assertions(1);
expect(issue.created_at).toStrictEqual('dummy-created-at');
});
it('should set the updated_at with the given issue updated_at', (): void => {
expect.assertions(1);
expect(issue.updated_at).toStrictEqual('dummy-updated-at');
});
it('should set the labels with the given issue labels', (): void => {
expect.assertions(1);
expect(issue.labels).toStrictEqual([
{
name: 'dummy-name'
} as ILabel
]);
});
it('should set the pull_request with the given issue pull_request', (): void => {
expect.assertions(1);
expect(issue.pull_request).toStrictEqual({});
});
it('should set the state with the given issue state', (): void => {
expect.assertions(1);
expect(issue.state).toStrictEqual('dummy-state');
});
it('should set the locked with the given issue locked', (): void => {
expect.assertions(1);
expect(issue.locked).toStrictEqual(false);
});
it('should set the milestone with the given issue milestone', (): void => {
expect.assertions(1);
expect(issue.milestone).toStrictEqual({
title: 'dummy-milestone'
} as IMilestone);
});
it('should set the assignees with the given issue assignees', (): void => {
expect.assertions(1);
expect(issue.assignees).toStrictEqual([
{
login: 'dummy-login',
type: 'User'
} as IUserAssignee
]);
});
describe('when the given issue does not contains the stale label', (): void => {
beforeEach((): void => {
issueInterface.pull_request = undefined;
issueInterface.labels = [];
issue = new Issue(optionsInterface, issueInterface);
});
it('should set the isStale to false', (): void => {
expect.assertions(1);
expect(issue.isStale).toStrictEqual(false);
});
});
describe('when the given issue contains the stale label', (): void => {
beforeEach((): void => {
issueInterface.pull_request = undefined;
issueInterface.labels = [
{
name: 'dummy-stale-issue-label'
} as ILabel
];
issue = new Issue(optionsInterface, issueInterface);
});
it('should set the isStale to true', (): void => {
expect.assertions(1);
expect(issue.isStale).toStrictEqual(true);
});
});
});
describe('get isPullRequest', (): void => {
describe('when the issue pull_request is not set', (): void => {
beforeEach((): void => {
issueInterface.pull_request = undefined;
issue = new Issue(optionsInterface, issueInterface);
});
it('should return false', (): void => {
expect.assertions(1);
const result = issue.isPullRequest;
expect(result).toStrictEqual(false);
});
});
describe('when the issue pull_request is set', (): void => {
beforeEach((): void => {
issueInterface.pull_request = {};
issue = new Issue(optionsInterface, issueInterface);
});
it('should return true', (): void => {
expect.assertions(1);
const result = issue.isPullRequest;
expect(result).toStrictEqual(true);
});
});
});
describe('get staleLabel', (): void => {
describe('when the issue is not a pull request', (): void => {
beforeEach((): void => {
issueInterface.pull_request = undefined;
issue = new Issue(optionsInterface, issueInterface);
});
it('should return the issue stale label', (): void => {
expect.assertions(1);
const result = issue.staleLabel;
expect(result).toStrictEqual('dummy-stale-issue-label');
});
});
describe('when the given issue is a pull request', (): void => {
beforeEach((): void => {
issueInterface.pull_request = {};
issue = new Issue(optionsInterface, issueInterface);
});
it('should return the pull request stale label', (): void => {
expect.assertions(1);
const result = issue.staleLabel;
expect(result).toStrictEqual('dummy-stale-pr-label');
});
});
});
describe('get hasAssignees', (): void => {
describe('when the issue has no assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [];
issue = new Issue(optionsInterface, issueInterface);
});
it('should return false', (): void => {
expect.assertions(1);
const result = issue.hasAssignees;
expect(result).toStrictEqual(false);
});
});
describe('when the issue has at least one assignee', (): void => {
beforeEach((): void => {
issueInterface.assignees = [
{
login: 'dummy-login',
type: 'User'
}
];
issue = new Issue(optionsInterface, issueInterface);
});
it('should return true', (): void => {
expect.assertions(1);
const result = issue.hasAssignees;
expect(result).toStrictEqual(true);
});
});
});
});

74
src/classes/issue.ts Normal file
View File

@@ -0,0 +1,74 @@
import {isLabeled} from '../functions/is-labeled';
import {isPullRequest} from '../functions/is-pull-request';
import {Assignee} from '../interfaces/assignee';
import {IIssue, OctokitIssue} from '../interfaces/issue';
import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options';
import {ILabel} from '../interfaces/label';
import {IMilestone} from '../interfaces/milestone';
import {IsoDateString} from '../types/iso-date-string';
import {Operations} from './operations';
export class Issue implements IIssue {
readonly title: string;
readonly number: number;
created_at: IsoDateString;
updated_at: IsoDateString;
readonly labels: ILabel[];
readonly pull_request: object | null | undefined;
readonly state: string | 'closed' | 'open';
readonly locked: boolean;
readonly milestone?: IMilestone | null;
readonly assignees: Assignee[];
isStale: boolean;
markedStaleThisRun: boolean;
operations = new Operations();
private readonly _options: IIssuesProcessorOptions;
constructor(
options: Readonly<IIssuesProcessorOptions>,
issue: Readonly<OctokitIssue> | Readonly<IIssue>
) {
this._options = options;
this.title = issue.title;
this.number = issue.number;
this.created_at = issue.created_at;
this.updated_at = issue.updated_at;
this.labels = mapLabels(issue.labels);
this.pull_request = issue.pull_request;
this.state = issue.state;
this.locked = issue.locked;
this.milestone = issue.milestone;
this.assignees = issue.assignees || [];
this.isStale = isLabeled(this, this.staleLabel);
this.markedStaleThisRun = false;
}
get isPullRequest(): boolean {
return isPullRequest(this);
}
get staleLabel(): string {
return this._getStaleLabel();
}
get hasAssignees(): boolean {
return this.assignees.length > 0;
}
private _getStaleLabel(): string {
return this.isPullRequest
? this._options.stalePrLabel
: this._options.staleIssueLabel;
}
}
function mapLabels(labels: (string | ILabel)[] | ILabel[]): ILabel[] {
return labels.map(label => {
if (typeof label == 'string') {
return {
name: label
};
}
return label;
});
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,193 @@
import {DefaultProcessorOptions} from '../../../__tests__/constants/default-processor-options';
import {generateIIssue} from '../../../__tests__/functions/generate-iissue';
import {Issue} from '../issue';
import {IssueLogger} from './issue-logger';
import * as core from '@actions/core';
describe('IssueLogger', (): void => {
let issue: Issue;
let issueLogger: IssueLogger;
let message: string;
let coreWarningSpy: jest.SpyInstance;
describe('warning()', (): void => {
beforeEach((): void => {
message = 'dummy-message';
issue = new Issue(
DefaultProcessorOptions,
generateIIssue({
number: 8
})
);
issueLogger = new IssueLogger(issue);
coreWarningSpy = jest.spyOn(core, 'warning').mockImplementation();
});
it('should log a warning with the given message and with the issue number as prefix', (): void => {
expect.assertions(3);
issueLogger.warning(message);
expect(coreWarningSpy).toHaveBeenCalledTimes(1);
expect(coreWarningSpy).toHaveBeenCalledWith(
expect.stringContaining('[#8]')
);
expect(coreWarningSpy).toHaveBeenCalledWith(
expect.stringContaining('dummy-message')
);
});
});
describe('info()', (): void => {
let coreInfoSpy: jest.SpyInstance;
beforeEach((): void => {
message = 'dummy-message';
issue = new Issue(
DefaultProcessorOptions,
generateIIssue({
number: 8
})
);
issueLogger = new IssueLogger(issue);
coreInfoSpy = jest.spyOn(core, 'info').mockImplementation();
});
it('should log an information with the given message and with the issue number as prefix', (): void => {
expect.assertions(3);
issueLogger.info(message);
expect(coreInfoSpy).toHaveBeenCalledTimes(1);
expect(coreInfoSpy).toHaveBeenCalledWith(expect.stringContaining('[#8]'));
expect(coreInfoSpy).toHaveBeenCalledWith(
expect.stringContaining('dummy-message')
);
});
});
describe('error()', (): void => {
let coreErrorSpy: jest.SpyInstance;
beforeEach((): void => {
message = 'dummy-message';
issue = new Issue(
DefaultProcessorOptions,
generateIIssue({
number: 8
})
);
issueLogger = new IssueLogger(issue);
coreErrorSpy = jest.spyOn(core, 'error').mockImplementation();
});
it('should log an error with the given message and with the issue number as prefix', (): void => {
expect.assertions(3);
issueLogger.error(message);
expect(coreErrorSpy).toHaveBeenCalledTimes(1);
expect(coreErrorSpy).toHaveBeenCalledWith(
expect.stringContaining('[#8]')
);
expect(coreErrorSpy).toHaveBeenCalledWith(
expect.stringContaining('dummy-message')
);
});
});
it('should prefix the message with the issue number', (): void => {
expect.assertions(3);
message = 'dummy-message';
issue = new Issue(
DefaultProcessorOptions,
generateIIssue({
number: 123
})
);
issueLogger = new IssueLogger(issue);
coreWarningSpy = jest.spyOn(core, 'warning').mockImplementation();
issueLogger.warning(message);
expect(coreWarningSpy).toHaveBeenCalledTimes(1);
expect(coreWarningSpy).toHaveBeenCalledWith(
expect.stringContaining('[#123]')
);
expect(coreWarningSpy).toHaveBeenCalledWith(
expect.stringContaining('dummy-message')
);
});
it.each`
pull_request | replacement
${{key: 'value'}} | ${'pull request'}
${{}} | ${'pull request'}
${null} | ${'issue'}
${undefined} | ${'issue'}
`(
'should replace the special tokens "$$type" with the corresponding type',
({pull_request, replacement}): void => {
expect.assertions(3);
message = 'The $$type will stale! $$type will soon be closed!';
issue = new Issue(
DefaultProcessorOptions,
generateIIssue({
number: 8,
pull_request
})
);
issueLogger = new IssueLogger(issue);
coreWarningSpy = jest.spyOn(core, 'warning').mockImplementation();
issueLogger.warning(message);
expect(coreWarningSpy).toHaveBeenCalledTimes(1);
expect(coreWarningSpy).toHaveBeenCalledWith(
expect.stringContaining(`[#8]`)
);
expect(coreWarningSpy).toHaveBeenCalledWith(
expect.stringContaining(
`The ${replacement} will stale! ${replacement} will soon be closed!`
)
);
}
);
it.each`
pull_request | replacement
${{key: 'value'}} | ${'Pull request'}
${{}} | ${'Pull request'}
${null} | ${'Issue'}
${undefined} | ${'Issue'}
`(
'should replace the special token "$$type" with the corresponding type with first letter as uppercase',
({pull_request, replacement}): void => {
expect.assertions(3);
message = '$$type will stale';
issue = new Issue(
DefaultProcessorOptions,
generateIIssue({
number: 8,
pull_request
})
);
issueLogger = new IssueLogger(issue);
coreWarningSpy = jest.spyOn(core, 'warning').mockImplementation();
issueLogger.warning(message);
expect(coreWarningSpy).toHaveBeenCalledTimes(1);
expect(coreWarningSpy).toHaveBeenCalledWith(
expect.stringContaining(`[#8]`)
);
expect(coreWarningSpy).toHaveBeenCalledWith(
expect.stringContaining(`${replacement} will stale`)
);
}
);
});

View File

@@ -0,0 +1,83 @@
import {Issue} from '../issue';
import {Logger} from './logger';
import {LoggerService} from '../../services/logger.service';
/**
* @description
* Each log will prefix the message with the issue number
*
* @example
* warning('No stale') => "[#123] No stale"
*
* Each log method can have special tokens:
* - $$type => will replace this by either "pull request" or "issue" depending of the type of issue
*
* @example
* warning('The $$type will stale') => "The pull request will stale"
*/
export class IssueLogger extends Logger {
private readonly _issue: Issue;
constructor(issue: Issue) {
super();
this._issue = issue;
}
warning(...message: string[]): void {
super.warning(this._format(...message));
}
info(...message: string[]): void {
super.info(this._format(...message));
}
error(...message: string[]): void {
super.error(this._format(...message));
}
async grouping(message: string, fn: () => Promise<void>): Promise<void> {
return super.grouping(this._format(message), fn);
}
private _replaceTokens(message: Readonly<string>): string {
return this._replaceTypeToken(message);
}
private _replaceTypeToken(message: Readonly<string>): string {
return message
.replace(
/^\$\$type/,
this._issue.isPullRequest ? 'Pull request' : 'Issue'
)
.replace(
/\$\$type/g,
this._issue.isPullRequest ? 'pull request' : 'issue'
);
}
private _prefixWithIssueNumber(message: Readonly<string>): string {
return `${this._getPrefix()} ${message}`;
}
private _getIssueNumber(): number {
return this._issue.number;
}
private _format(...message: string[]): string {
return this._prefixWithIssueNumber(this._replaceTokens(message.join(' ')));
}
private _getPrefix(): string {
return this._issue.isPullRequest
? this._getPullRequestPrefix()
: this._getIssuePrefix();
}
private _getIssuePrefix(): string {
return LoggerService.red(`[#${this._getIssueNumber()}]`);
}
private _getPullRequestPrefix(): string {
return LoggerService.blue(`[#${this._getIssueNumber()}]`);
}
}

View File

@@ -0,0 +1,79 @@
import {Logger} from './logger';
import * as core from '@actions/core';
describe('Logger', (): void => {
let logger: Logger;
beforeEach((): void => {
logger = new Logger();
});
describe('warning()', (): void => {
let message: string;
let coreWarningSpy: jest.SpyInstance;
beforeEach((): void => {
message = 'dummy-message';
coreWarningSpy = jest.spyOn(core, 'warning').mockImplementation();
});
it('should log a warning with the given message', (): void => {
expect.assertions(2);
logger.warning(message);
expect(coreWarningSpy).toHaveBeenCalledTimes(1);
expect(coreWarningSpy).toHaveBeenCalledWith(
expect.stringContaining('dummy-message')
);
});
});
describe('info()', (): void => {
let message: string;
let coreInfoSpy: jest.SpyInstance;
beforeEach((): void => {
message = 'dummy-message';
coreInfoSpy = jest.spyOn(core, 'info').mockImplementation();
});
it('should log an information with the given message', (): void => {
expect.assertions(2);
logger.info(message);
expect(coreInfoSpy).toHaveBeenCalledTimes(1);
expect(coreInfoSpy).toHaveBeenCalledWith(
expect.stringContaining('dummy-message')
);
});
});
describe('error()', (): void => {
let message: string;
let coreErrorSpy: jest.SpyInstance;
beforeEach((): void => {
message = 'dummy-message';
coreErrorSpy = jest.spyOn(core, 'error').mockImplementation();
});
it('should log an error with the given message', (): void => {
expect.assertions(2);
logger.error(message);
expect(coreErrorSpy).toHaveBeenCalledTimes(1);
expect(coreErrorSpy).toHaveBeenCalledWith(
expect.stringContaining('dummy-message')
);
});
});
});

View File

@@ -0,0 +1,32 @@
import * as core from '@actions/core';
import terminalLink from 'terminal-link';
import {Option} from '../../enums/option';
import {LoggerService} from '../../services/logger.service';
export class Logger {
warning(...message: string[]): void {
core.warning(LoggerService.whiteBright(message.join(' ')));
}
info(...message: string[]): void {
core.info(LoggerService.whiteBright(message.join(' ')));
}
error(...message: string[]): void {
core.error(LoggerService.whiteBright(message.join(' ')));
}
async grouping(message: string, fn: () => Promise<void>): Promise<void> {
return core.group(LoggerService.whiteBright(message), fn);
}
createLink(name: Readonly<string>, link: Readonly<string>): string {
return terminalLink(name, link);
}
createOptionLink(option: Readonly<Option>): string {
return LoggerService.magenta(
this.createLink(option, `https://github.com/actions/stale#${option}`)
);
}
}

View File

@@ -0,0 +1,798 @@
import {DefaultProcessorOptions} from '../../__tests__/constants/default-processor-options';
import {generateIIssue} from '../../__tests__/functions/generate-iissue';
import {IIssue} from '../interfaces/issue';
import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options';
import {Issue} from './issue';
import {Milestones} from './milestones';
describe('Milestones', (): void => {
let milestones: Milestones;
let optionsInterface: IIssuesProcessorOptions;
let issue: Issue;
let issueInterface: IIssue;
beforeEach((): void => {
optionsInterface = {...DefaultProcessorOptions, exemptAllMilestones: false};
issueInterface = generateIIssue();
});
describe('shouldExemptMilestones()', (): void => {
describe('when the given issue is not a pull request', (): void => {
beforeEach((): void => {
issueInterface.pull_request = undefined;
});
describe('when the given options are not configured to exempt a milestone', (): void => {
beforeEach((): void => {
optionsInterface.exemptMilestones = '';
});
describe('when the given options are not configured to exempt an issue milestone', (): void => {
beforeEach((): void => {
optionsInterface.exemptIssueMilestones = '';
});
describe('when the given issue does not have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = undefined;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-title'
};
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
});
describe('when the given options are configured to exempt an issue milestone', (): void => {
beforeEach((): void => {
optionsInterface.exemptIssueMilestones =
'dummy-exempt-issue-milestone';
});
describe('when the given issue does not have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = undefined;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have a milestone different than the exempt issue milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-title'
};
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have a milestone equaling the exempt issue milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-exempt-issue-milestone'
};
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(true);
});
});
});
});
describe('when the given options are configured to exempt a milestone', (): void => {
beforeEach((): void => {
optionsInterface.exemptMilestones = 'dummy-exempt-milestone';
});
describe('when the given options are not configured to exempt an issue milestone', (): void => {
beforeEach((): void => {
optionsInterface.exemptIssueMilestones = '';
});
describe('when the given issue does not have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = undefined;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have a milestone different than the exempt milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-title'
};
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have a milestone equaling the exempt milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-exempt-milestone'
};
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(true);
});
});
});
describe('when the given options are configured to exempt an issue milestone', (): void => {
beforeEach((): void => {
optionsInterface.exemptIssueMilestones =
'dummy-exempt-issue-milestone';
});
describe('when the given issue does not have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = undefined;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have a milestone different than the exempt issue milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-title'
};
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have a milestone equaling the exempt issue milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-exempt-issue-milestone'
};
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(true);
});
});
describe('when the given issue does have a milestone different than the exempt milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-title'
};
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have a milestone equaling the exempt milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-exempt-milestone'
};
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
});
});
describe('when the given options are configured to exempt all milestones', (): void => {
beforeEach((): void => {
optionsInterface.exemptAllMilestones = true;
});
describe('when the given issue does not have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = undefined;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-exempt-issue-milestone'
};
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(true);
});
});
describe('when the given options are not configured to exempt all issue milestones', (): void => {
beforeEach((): void => {
optionsInterface.exemptAllIssueMilestones = false;
});
describe('when the given issue does not have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = undefined;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-exempt-milestone'
};
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
});
describe('when the given options are configured to exempt all issue milestones', (): void => {
beforeEach((): void => {
optionsInterface.exemptAllIssueMilestones = true;
});
describe('when the given issue does not have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = undefined;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given issue does have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-exempt-issue-milestone'
};
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(true);
});
});
});
});
});
describe('when the given issue is a pull request', (): void => {
beforeEach((): void => {
issueInterface.pull_request = {};
});
describe('when the given options are not configured to exempt a milestone', (): void => {
beforeEach((): void => {
optionsInterface.exemptMilestones = '';
});
describe('when the given options are not configured to exempt a pull request milestone', (): void => {
beforeEach((): void => {
optionsInterface.exemptPrMilestones = '';
});
describe('when the given pull request does not have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = undefined;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-title'
};
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
});
describe('when the given options are configured to exempt a pull request milestone', (): void => {
beforeEach((): void => {
optionsInterface.exemptPrMilestones = 'dummy-exempt-pr-milestone';
});
describe('when the given pull request does not have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = undefined;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have a milestone different than the exempt pull request milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-title'
};
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have a milestone equaling the exempt pull request milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-exempt-pr-milestone'
};
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(true);
});
});
});
});
describe('when the given options are configured to exempt a milestone', (): void => {
beforeEach((): void => {
optionsInterface.exemptMilestones = 'dummy-exempt-milestone';
});
describe('when the given options are not configured to exempt a pull request milestone', (): void => {
beforeEach((): void => {
optionsInterface.exemptPrMilestones = '';
});
describe('when the given pull request does not have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = undefined;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have a milestone different than the exempt milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-title'
};
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have a milestone equaling the exempt milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-exempt-milestone'
};
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(true);
});
});
});
describe('when the given options are configured to exempt a pull request milestone', (): void => {
beforeEach((): void => {
optionsInterface.exemptPrMilestones = 'dummy-exempt-pr-milestone';
});
describe('when the given pull request does not have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = undefined;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have a milestone different than the exempt pull request milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-title'
};
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have a milestone equaling the exempt pull request milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-exempt-pr-milestone'
};
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(true);
});
});
describe('when the given pull request does have a milestone different than the exempt milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-title'
};
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have a milestone equaling the exempt milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-exempt-milestone'
};
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
});
});
describe('when the given options are configured to exempt all milestones', (): void => {
beforeEach((): void => {
optionsInterface.exemptAllMilestones = true;
});
describe('when the given pull request does not have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = undefined;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-exempt-pr-milestone'
};
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(true);
});
});
describe('when the given options are not configured to exempt all pull request milestones', (): void => {
beforeEach((): void => {
optionsInterface.exemptAllPrMilestones = false;
});
describe('when the given pull request does not have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = undefined;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-exempt-milestone'
};
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
});
describe('when the given options are configured to exempt all pull request milestones', (): void => {
beforeEach((): void => {
optionsInterface.exemptAllPrMilestones = true;
});
describe('when the given pull request does not have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = undefined;
});
it('should return false', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(false);
});
});
describe('when the given pull request does have a milestone', (): void => {
beforeEach((): void => {
issueInterface.milestone = {
title: 'dummy-exempt-pr-milestone'
};
});
it('should return true', (): void => {
expect.assertions(1);
issue = new Issue(optionsInterface, issueInterface);
milestones = new Milestones(optionsInterface, issue);
const result = milestones.shouldExemptMilestones();
expect(result).toStrictEqual(true);
});
});
});
});
});
});
});

297
src/classes/milestones.ts Normal file
View File

@@ -0,0 +1,297 @@
import deburr from 'lodash.deburr';
import {Option} from '../enums/option';
import {wordsToList} from '../functions/words-to-list';
import {IIssuesProcessorOptions} from '../interfaces/issues-processor-options';
import {Issue} from './issue';
import {IssueLogger} from './loggers/issue-logger';
import {LoggerService} from '../services/logger.service';
type CleanMilestone = string;
export class Milestones {
private static _cleanMilestone(milestone: Readonly<string>): CleanMilestone {
return deburr(milestone.toLowerCase());
}
private readonly _options: IIssuesProcessorOptions;
private readonly _issue: Issue;
private readonly _issueLogger: IssueLogger;
constructor(options: Readonly<IIssuesProcessorOptions>, issue: Issue) {
this._options = options;
this._issue = issue;
this._issueLogger = new IssueLogger(issue);
}
shouldExemptMilestones(): boolean {
if (!this._issue.milestone) {
this._issueLogger.info('This $$type has no milestone');
this._logSkip();
return false;
}
if (this._shouldExemptAllMilestones()) {
this._issueLogger.info(
LoggerService.white('└──'),
'Skipping this $$type because it has a milestone'
);
return true;
}
const exemptMilestones: string[] = this._getExemptMilestones();
if (exemptMilestones.length === 0) {
this._issueLogger.info(
LoggerService.white('├──'),
`No milestone option was specified to skip the stale process for this $$type`
);
this._logSkip();
return false;
}
this._issueLogger.info(
LoggerService.white('├──'),
`Found ${LoggerService.cyan(exemptMilestones.length)} milestone${
exemptMilestones.length > 1 ? 's' : ''
} that can exempt stale on this $$type`
);
const hasExemptMilestone: boolean = exemptMilestones.some(
(exemptMilestone: Readonly<string>): boolean =>
this._hasMilestone(exemptMilestone)
);
if (!hasExemptMilestone) {
this._issueLogger.info(
LoggerService.white('├──'),
'No milestone on this $$type can exempt the stale process'
);
this._logSkip();
} else {
this._issueLogger.info(
LoggerService.white('└──'),
'Skipping this $$type because it has an exempt milestone'
);
}
return hasExemptMilestone;
}
private _getExemptMilestones(): string[] {
return this._issue.isPullRequest
? this._getExemptPullRequestMilestones()
: this._getExemptIssueMilestones();
}
private _getExemptIssueMilestones(): string[] {
if (this._options.exemptIssueMilestones === '') {
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptIssueMilestones
)} is disabled. No specific milestone can skip the stale process for this $$type`
);
if (this._options.exemptMilestones === '') {
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptMilestones
)} is disabled. No specific milestone can skip the stale process for this $$type`
);
return [];
}
const exemptMilestones: string[] = wordsToList(
this._options.exemptMilestones
);
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptMilestones
)} is set. ${LoggerService.cyan(exemptMilestones.length)} milestone${
exemptMilestones.length === 1 ? '' : 's'
} can skip the stale process for this $$type`
);
return exemptMilestones;
}
const exemptMilestones: string[] = wordsToList(
this._options.exemptIssueMilestones
);
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptIssueMilestones
)} is set. ${LoggerService.cyan(exemptMilestones.length)} milestone${
exemptMilestones.length === 1 ? '' : 's'
} can skip the stale process for this $$type`
);
return exemptMilestones;
}
private _getExemptPullRequestMilestones(): string[] {
if (this._options.exemptPrMilestones === '') {
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptPrMilestones
)} is disabled. No specific milestone can skip the stale process for this $$type`
);
if (this._options.exemptMilestones === '') {
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptMilestones
)} is disabled. No specific milestone can skip the stale process for this $$type`
);
return [];
}
const exemptMilestones: string[] = wordsToList(
this._options.exemptMilestones
);
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptMilestones
)} is set. ${LoggerService.cyan(exemptMilestones.length)} milestone${
exemptMilestones.length === 1 ? '' : 's'
} can skip the stale process for this $$type`
);
return exemptMilestones;
}
const exemptMilestones: string[] = wordsToList(
this._options.exemptPrMilestones
);
this._issueLogger.info(
LoggerService.white('├──'),
`The option ${this._issueLogger.createOptionLink(
Option.ExemptPrMilestones
)} is set. ${LoggerService.cyan(exemptMilestones.length)} milestone${
exemptMilestones.length === 1 ? '' : 's'
} can skip the stale process for this $$type`
);
return exemptMilestones;
}
private _hasMilestone(milestone: Readonly<string>): boolean {
if (!this._issue.milestone) {
return false;
}
const cleanMilestone: CleanMilestone =
Milestones._cleanMilestone(milestone);
const isSameMilestone: boolean =
cleanMilestone ===
Milestones._cleanMilestone(this._issue.milestone.title);
if (isSameMilestone) {
this._issueLogger.info(
LoggerService.white('├──'),
`The milestone "${LoggerService.cyan(
milestone
)}" is set on this $$type and is an exempt milestone`
);
}
return isSameMilestone;
}
private _shouldExemptAllMilestones(): boolean {
if (this._issue.milestone) {
return this._issue.isPullRequest
? this._shouldExemptAllPullRequestMilestones()
: this._shouldExemptAllIssueMilestones();
}
return false;
}
private _shouldExemptAllIssueMilestones(): boolean {
if (this._options.exemptAllIssueMilestones === true) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAllIssueMilestones
)} is enabled. Any milestone on this $$type will skip the stale process`
);
return true;
} else if (this._options.exemptAllIssueMilestones === false) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAllIssueMilestones
)} is disabled. Only some specific milestones on this $$type will skip the stale process`
);
return false;
}
this._logExemptAllMilestonesOption();
return this._options.exemptAllMilestones;
}
private _shouldExemptAllPullRequestMilestones(): boolean {
if (this._options.exemptAllPrMilestones === true) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAllPrMilestones
)} is enabled. Any milestone on this $$type will skip the stale process`
);
return true;
} else if (this._options.exemptAllPrMilestones === false) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAllPrMilestones
)} is disabled. Only some specific milestones on this $$type will skip the stale process`
);
return false;
}
this._logExemptAllMilestonesOption();
return this._options.exemptAllMilestones;
}
private _logExemptAllMilestonesOption(): void {
if (this._options.exemptAllMilestones) {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAllMilestones
)} is enabled. Any milestone on this $$type will skip the stale process`
);
} else {
this._issueLogger.info(
`The option ${this._issueLogger.createOptionLink(
Option.ExemptAllMilestones
)} is disabled. Only some specific milestones on this $$type will skip the stale process`
);
}
}
private _logSkip(): void {
this._issueLogger.info(
LoggerService.white('└──'),
'Skip the milestones checks'
);
}
}

View File

@@ -0,0 +1,49 @@
import {Operations} from './operations';
describe('Operations', (): void => {
let operations: Operations;
describe('consumeOperation()', (): void => {
beforeEach((): void => {
operations = new Operations();
});
it('should increase the count of operation consume by 1', (): void => {
expect.assertions(1);
operations.consumeOperation();
const result = operations.getConsumedOperationsCount();
expect(result).toStrictEqual(1);
});
});
describe('consumeOperations()', (): void => {
beforeEach((): void => {
operations = new Operations();
});
it('should increase the count of operation consume by the provided quantity', (): void => {
expect.assertions(1);
operations.consumeOperations(8);
const result = operations.getConsumedOperationsCount();
expect(result).toStrictEqual(8);
});
});
describe('getConsumedOperationsCount()', (): void => {
beforeEach((): void => {
operations = new Operations();
});
it('should return 0 by default', (): void => {
expect.assertions(1);
const result = operations.getConsumedOperationsCount();
expect(result).toStrictEqual(0);
});
});
});

17
src/classes/operations.ts Normal file
View File

@@ -0,0 +1,17 @@
export class Operations {
protected _operationsConsumed = 0;
consumeOperation(): Operations {
return this.consumeOperations(1);
}
consumeOperations(quantity: Readonly<number>): Operations {
this._operationsConsumed += quantity;
return this;
}
getConsumedOperationsCount(): number {
return this._operationsConsumed;
}
}

Some files were not shown because too many files have changed in this diff Show More