Compare commits

...

228 Commits
v4 ... main

Author SHA1 Message Date
Chiranjib Swain
25abb3cad4 Improve Labeler Action Documentation and Error Handling for Permissions (#897)
* Update README.md and labeler.ts to clarify permissions for GitHub Labeler Action

* Update dist/index.js with latest build changes

* Update README.md to clarify manual label creation as an alternative to granting issues write permission

* Fix labeler error handling to ensure case-insensitive check for unauthorized access

* Refactor error handling in labeler to throw an error for unauthorized access instead of logging

* Add tests for labeler error handling and improve error reporting
2025-09-19 14:46:04 -05:00
dependabot[bot]
395c8cfdb1 Bump brace-expansion from 1.1.11 to 1.1.12 and document breaking changes in v6 (#877)
* Bump brace-expansion from 1.1.11 to 1.1.12

Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.11 to 1.1.12.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/1.1.11...v1.1.12)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.12
  dependency-type: indirect
...

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

* documentation update and check failure fix

* doc update

* doc updates

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aparna Jyothi <aparnajyothi-y@github.com>
2025-09-16 13:25:22 -05:00
aparnajyothi-y
634933edcd publish-action upgrade to 0.4.0 from 0.2.2 (#901) 2025-09-04 12:20:23 -05:00
Salman Chishti
f1a63e87db Update Node.js version to 24 in action and dependencies (#891)
* Update Node.js version to 24 in action and dependencies

Bump the required Node.js version to 24 in action.yml and package.json. Update @types/node to ^24.1.0 to match the new Node.js version.

* package.json version update

* update to the latest versions

---------

Co-authored-by: Aparna Jyothi <aparnajyothi-y@github.com>
2025-09-03 22:24:18 -05:00
dependabot[bot]
b0a1180683 Bump @octokit/request-error from 5.0.1 to 5.1.1 (#846)
* Bump @octokit/request-error from 5.0.1 to 5.1.1

Bumps [@octokit/request-error](https://github.com/octokit/request-error.js) from 5.0.1 to 5.1.1.
- [Release notes](https://github.com/octokit/request-error.js/releases)
- [Commits](https://github.com/octokit/request-error.js/compare/v5.0.1...v5.1.1)

---
updated-dependencies:
- dependency-name: "@octokit/request-error"
  dependency-type: indirect
...

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

* check failures fix

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aparna Jyothi <aparnajyothi-y@github.com>
2025-07-29 12:08:39 -05:00
suyashgaonkar
110d44140c Update README.md (#871) 2025-07-14 14:59:24 -05:00
dependabot[bot]
bee50fefe1 Bump undici from 5.28.4 to 5.28.5 (#842)
* Bump undici from 5.28.4 to 5.28.5

Bumps [undici](https://github.com/nodejs/undici) from 5.28.4 to 5.28.5.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.4...v5.28.5)

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

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

* Fix Failures

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: HarithaVattikuti <73516759+HarithaVattikuti@users.noreply.github.com>
2025-06-10 15:29:08 -05:00
dependabot[bot]
6463cdb00e Bump eslint-plugin-jest from 28.9.0 to 28.11.0 (#839)
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 28.9.0 to 28.11.0.
- [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/v28.9.0...v28.11.0)

---
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>
2025-02-19 17:08:51 -06:00
dependabot[bot]
c209686724 Bump typescript from 5.7.2 to 5.7.3 (#835)
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.7.2 to 5.7.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.7.2...v5.7.3)

---
updated-dependencies:
- dependency-name: typescript
  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>
2025-02-13 14:39:42 -06:00
dependabot[bot]
5184940b54 Bump @vercel/ncc from 0.38.1 to 0.38.3 (#830)
* Bump @vercel/ncc from 0.38.1 to 0.38.3

Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.38.1 to 0.38.3.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.1...0.38.3)

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

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

* fix-check failures also

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aparna Jyothi <aparnajyothi-y@github.com>
2025-02-13 14:38:51 -06:00
HarithaVattikuti
3629d5568b Document update - permission section (#840)
* Update Section

* Update warning
2025-01-16 08:46:55 -06:00
dependabot[bot]
d24f7f3731 Bump ts-jest from 29.1.2 to 29.2.5 (#831)
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 29.1.2 to 29.2.5.
- [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/v29.1.2...v29.2.5)

---
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>
2024-12-19 11:38:22 -06:00
dependabot[bot]
425a1f1422 Bump eslint-plugin-jest from 27.9.0 to 28.9.0 (#832)
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 27.9.0 to 28.9.0.
- [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/v27.9.0...v28.9.0)

---
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>
2024-12-19 11:37:31 -06:00
dependabot[bot]
2755f92612 Bump @types/jest from 29.5.12 to 29.5.14 (#827)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.12 to 29.5.14.
- [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>
2024-12-17 11:54:18 -06:00
dependabot[bot]
31efb45c79 Bump prettier from 3.2.5 to 3.4.2 (#825)
Bumps [prettier](https://github.com/prettier/prettier) from 3.2.5 to 3.4.2.
- [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/3.2.5...3.4.2)

---
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>
2024-12-17 11:40:17 -06:00
dependabot[bot]
deb1c03ec1 Bump @typescript-eslint/parser from 7.3.1 to 8.17.0 (#824)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 7.3.1 to 8.17.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/v8.17.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  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>
2024-12-17 11:30:47 -06:00
dependabot[bot]
a261db4c87 Bump typescript from 5.4.3 to 5.7.2 (#819)
* Bump typescript from 5.4.3 to 5.7.2

Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.4.3 to 5.7.2.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.4.3...v5.7.2)

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

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

* npm run build

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aparna Jyothi <aparnajyothi-y@github.com>
2024-12-17 11:23:00 -06:00
dependabot[bot]
5838aad63e Bump @actions/core from 1.10.1 to 1.11.1 (#811)
* Bump @actions/core from 1.10.1 to 1.11.1

Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.10.1 to 1.11.1.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* npm run build

* licensed cache

* licensed cache

* licensed

* licensed check failure fix

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aparna Jyothi <aparnajyothi-y@github.com>
2024-12-16 08:39:04 -06:00
dependabot[bot]
98d12e7f87 Bump minimatch from 9.0.3 to 10.0.1 (#805)
* Bump minimatch from 9.0.3 to 10.0.1

Bumps [minimatch](https://github.com/isaacs/minimatch) from 9.0.3 to 10.0.1.
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v9.0.3...v10.0.1)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

* check failues fix

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aparna Jyothi <aparnajyothi-y@github.com>
2024-12-12 21:22:05 -06:00
suyashgaonkar
857d8ca96a Update README.md (#822) 2024-12-10 14:36:38 -06:00
Joel Ambass
bb8f002e4f Merge pull request #802 from actions/Jcambass-patch-1
Add workflow file for publishing releases to immutable action package
2024-09-26 08:24:34 +02:00
dependabot[bot]
70db055cd5 Bump braces from 3.0.2 to 3.0.3 (#789)
* Bump braces from 3.0.2 to 3.0.3

Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

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

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

* Bump undici from 5.28.3 to 5.28.4.

* License update

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: HarithaVattikuti <73516759+HarithaVattikuti@users.noreply.github.com>
2024-09-17 09:45:00 -05:00
Joel Ambass
2e99c4dc10 Add workflow file for publishing releases to immutable action package
This workflow file publishes new action releases to the immutable action package of the same name as this repo.

This is part of the Immutable Actions project which is not yet fully released to the public. First party actions like this one are part of our initial testing of this feature.
2024-09-16 17:56:39 +02:00
dependabot[bot]
506e1a00c6 Bump undici from 5.26.5 to 5.28.3 (#757)
* Bump undici from 5.26.5 to 5.28.3

Bumps [undici](https://github.com/nodejs/undici) from 5.26.5 to 5.28.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.26.5...v5.28.3)

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

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

* fix check failures

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: HarithaVattikuti <73516759+HarithaVattikuti@users.noreply.github.com>
2024-04-04 11:04:15 -05:00
dependabot[bot]
83720bce86 Bump prettier from 3.1.1 to 3.2.5 (#752)
Bumps [prettier](https://github.com/prettier/prettier) from 3.1.1 to 3.2.5.
- [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/3.1.1...3.2.5)

---
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>
2024-02-28 10:18:06 -06:00
dependabot[bot]
e5bd067930 Bump @typescript-eslint/eslint-plugin from 6.9.0 to 6.20.0 (#750)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.9.0 to 6.20.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/v6.20.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-01 14:31:19 -06:00
dependabot[bot]
b2b2c20d44 Bump eslint-plugin-jest from 27.4.3 to 27.6.3 (#744)
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 27.4.3 to 27.6.3.
- [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/v27.4.3...v27.6.3)

---
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>
2024-01-23 13:40:36 -06:00
dependabot[bot]
02180c4758 Bump @typescript-eslint/parser from 6.14.0 to 6.19.0 (#745)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.14.0 to 6.19.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/v6.19.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-22 13:46:43 -06:00
MaksimZhukov
17086b7743 Merge pull request #725 from actions/dependabot/npm_and_yarn/eslint-8.56.0
Bump eslint from 8.55.0 to 8.56.0
2023-12-18 17:19:56 +01:00
dependabot[bot]
5e969e09f0 Bump eslint from 8.55.0 to 8.56.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.55.0 to 8.56.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.55.0...v8.56.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 15:53:54 +00:00
MaksimZhukov
035de5e30d Merge pull request #726 from actions/dependabot/npm_and_yarn/prettier-3.1.1
Bump prettier from 3.0.3 to 3.1.1
2023-12-18 16:52:28 +01:00
dependabot[bot]
73e8e27589 Bump prettier from 3.0.3 to 3.1.1
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.1.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/3.0.3...3.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 15:48:47 +00:00
MaksimZhukov
ccee68d6cf Merge pull request #717 from actions/dependabot/npm_and_yarn/typescript-eslint/parser-6.14.0
Bump @typescript-eslint/parser from 6.9.0 to 6.14.0
2023-12-18 16:48:25 +01:00
MaksimZhukov
2b7003274c Merge pull request #718 from actions/dependabot/npm_and_yarn/types/js-yaml-4.0.9
Bump @types/js-yaml from 4.0.8 to 4.0.9
2023-12-18 16:47:50 +01:00
dependabot[bot]
90cc4c2623 Bump @types/js-yaml from 4.0.8 to 4.0.9
Bumps [@types/js-yaml](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/js-yaml) from 4.0.8 to 4.0.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/js-yaml)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 14:34:19 +00:00
dependabot[bot]
4a56a41318 Bump @typescript-eslint/parser from 6.9.0 to 6.14.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.9.0 to 6.14.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/v6.14.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-12-18 14:33:47 +00:00
MaksimZhukov
aa18a3cacc Merge pull request #719 from actions/dependabot/npm_and_yarn/types/jest-29.5.11
Bump @types/jest from 29.5.6 to 29.5.11
2023-12-18 15:33:01 +01:00
MaksimZhukov
dea3f9b186 Merge pull request #720 from actions/dependabot/npm_and_yarn/eslint-8.55.0
Bump eslint from 8.52.0 to 8.55.0
2023-12-18 15:32:34 +01:00
Ivan
0ad0ff974e Update readme with additional examples and important note about pull_request_target event (#721)
* docs: add note about pull_request_target event trigger

* docs: change note from being caution to important

* docs: fix typos

* docs: add examples to the examples chapter

* docs: fix typos
2023-12-18 13:34:14 +01:00
dependabot[bot]
4b5201e562 Bump eslint from 8.52.0 to 8.55.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.52.0 to 8.55.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.52.0...v8.55.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-14 15:30:33 +00:00
dependabot[bot]
ccaeba86e2 Bump @types/jest from 29.5.6 to 29.5.11
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.6 to 29.5.11.
- [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>
2023-12-14 15:30:21 +00:00
MaksimZhukov
08bb101f04 Merge pull request #711 from actions/dependabot/npm_and_yarn/eslint-config-prettier-9.1.0
Bump eslint-config-prettier from 9.0.0 to 9.1.0
2023-12-14 16:03:34 +01:00
MaksimZhukov
f9ea084de7 Merge pull request #669 from silverwind/patch-1
Add note regarding `pull_request_target` to README.md
2023-12-13 16:27:02 +01:00
dependabot[bot]
587debe10c Bump eslint-config-prettier from 9.0.0 to 9.1.0
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 9.0.0 to 9.1.0.
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v9.0.0...v9.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-04 15:50:37 +00:00
MaksimZhukov
8558fd7429 Merge pull request #709 from actions/v5.0.0-beta
Transfer changes from beta version to main
2023-12-04 15:05:45 +01:00
MaksimZhukov
000ca75fe6 Merge pull request #700 from MaksimZhukov/apply-suggestions-and-update-documentation
Apply suggestions for the beta version and update the documentation
2023-11-08 12:25:35 +01:00
MaksimZhukov
cb66c2f078 Update dist 2023-10-31 13:39:41 +01:00
MaksimZhukov
9181355e36 Apply suggestions for the beta vesrion and update the documentation 2023-10-31 13:09:20 +01:00
MaksimZhukov
efe4c1c90e Merge pull request #699 from MaksimZhukov/update-node-runtime-and-dependencies
Update Node.js runtime and dependencies
2023-10-26 13:37:29 +02:00
MaksimZhukov
c0957ad7c3 Run Prettier 2023-10-25 14:54:32 +02:00
MaksimZhukov
8dc8d1842f Update Node.js version in reusable workflows 2023-10-25 14:47:35 +02:00
MaksimZhukov
d0d0bbebfb Update documentation 2023-10-25 14:28:34 +02:00
MaksimZhukov
1375c42512 5.0.0 2023-10-25 14:25:19 +02:00
MaksimZhukov
ab7411ec21 Change version of Node.js runtime to node20 2023-10-25 14:25:13 +02:00
MaksimZhukov
917e5cce72 Merge branch 'main' 2023-10-24 12:11:31 +02:00
dependabot[bot]
212b4a75b7 Bump @babel/traverse from 7.20.12 to 7.23.2 (#697)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.20.12 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-19 10:12:37 +02:00
dependabot[bot]
f3aca66a22 Bump eslint-plugin-jest from 27.4.0 to 27.4.2 (#694)
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 27.4.0 to 27.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/v27.4.0...v27.4.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-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>
2023-10-11 12:36:17 +02:00
dependabot[bot]
3985e4151a Bump eslint from 8.49.0 to 8.51.0 (#693)
Bumps [eslint](https://github.com/eslint/eslint) from 8.49.0 to 8.51.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.49.0...v8.51.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>
2023-10-10 12:44:56 +02:00
Nikolai Laevskii
0b00d259ba Merge pull request #691 from akv-platform/v4-general-refactoring
Labeler general refactoring (ver. 4)
2023-10-09 07:12:12 +02:00
Nikolai Laevskii
dd1ca3d590 Merge remote-tracking branch 'origin' into v4-general-refactoring 2023-10-04 11:29:04 +02:00
Nikolai Laevskii
df65a7144a Use lodash's isEqual 2023-10-04 11:23:34 +02:00
dependabot[bot]
8207c1460c Bump @typescript-eslint/eslint-plugin from 6.7.0 to 6.7.4 (#690)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.7.0 to 6.7.4.
- [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/v6.7.4/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  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>
2023-10-04 09:02:52 +02:00
Nikolai Laevskii
27ee87f076 Update naming 2023-09-25 15:28:47 +02:00
dependabot[bot]
2b2e7d04cb Bump @typescript-eslint/parser from 6.7.0 to 6.7.2 (#682)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.7.0 to 6.7.2.
- [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/v6.7.2/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  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>
2023-09-21 14:51:14 +02:00
MaksimZhukov
f4eefdc659 [Beta] Implement the new structure of the match object for the changed-files section (#680)
* Implement the new structure of the match object for changed files section

* Replace inner loops with the find method
2023-09-20 13:43:39 +02:00
dependabot[bot]
519694ef2f Bump @types/js-yaml from 4.0.5 to 4.0.6 (#679)
Bumps [@types/js-yaml](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/js-yaml) from 4.0.5 to 4.0.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/js-yaml)

---
updated-dependencies:
- dependency-name: "@types/js-yaml"
  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>
2023-09-20 09:20:51 +02:00
dependabot[bot]
c53368623a Bump eslint-plugin-jest from 27.2.3 to 27.4.0 (#678)
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 27.2.3 to 27.4.0.
- [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/v27.2.3...v27.4.0)

---
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>
2023-09-19 13:18:42 +02:00
dependabot[bot]
6c834e41a8 Bump @typescript-eslint/parser from 6.6.0 to 6.7.0 (#677)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.6.0 to 6.7.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/v6.7.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-14 12:41:42 +02:00
dependabot[bot]
725d4ca893 Bump @typescript-eslint/eslint-plugin from 6.6.0 to 6.7.0 (#676)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.6.0 to 6.7.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/v6.7.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 10:14:55 +02:00
dependabot[bot]
ccd4640a2c Bump eslint from 8.48.0 to 8.49.0 (#671)
Bumps [eslint](https://github.com/eslint/eslint) from 8.48.0 to 8.49.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.48.0...v8.49.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>
2023-09-12 10:39:56 +02:00
silverwind
92c8874170 Update README.md 2023-09-08 11:46:17 +02:00
silverwind
c3a152eec1 Add note regarding pull_request_target to README.md
I think this is a big gotcha that should be called out in the documentation. I've been trying to debug why the workflow did not run for a long time, until I finally understood the underlying issue.
2023-09-08 11:43:56 +02:00
dependabot[bot]
a76cf44ddb Bump @typescript-eslint/parser from 6.5.0 to 6.6.0 (#666)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.5.0 to 6.6.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/v6.6.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 10:41:12 +02:00
dependabot[bot]
14fcf05d5e Bump @typescript-eslint/eslint-plugin from 6.5.0 to 6.6.0 (#665)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.5.0 to 6.6.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/v6.6.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 10:28:19 +02:00
dependabot[bot]
59718b0b66 Bump @typescript-eslint/parser from 6.4.1 to 6.5.0 (#661)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.4.1 to 6.5.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/v6.5.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 08:45:56 +02:00
dependabot[bot]
cc1a954400 Bump @typescript-eslint/eslint-plugin from 6.4.1 to 6.5.0 (#660)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.4.1 to 6.5.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/v6.5.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 08:41:06 +02:00
dependabot[bot]
d09ea578e9 Bump prettier from 3.0.2 to 3.0.3 (#659)
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.2 to 3.0.3.
- [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/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: prettier
  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>
2023-08-30 08:40:33 +02:00
dependabot[bot]
5ede40d9ff Bump eslint from 8.47.0 to 8.48.0 (#658)
Bumps [eslint](https://github.com/eslint/eslint) from 8.47.0 to 8.48.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.47.0...v8.48.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>
2023-08-29 12:37:40 +02:00
dependabot[bot]
bb8a4df924 Bump @typescript-eslint/eslint-plugin from 6.4.0 to 6.4.1 (#655)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.4.0 to 6.4.1.
- [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/v6.4.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  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>
2023-08-23 15:59:39 +02:00
dependabot[bot]
78e4f87e68 Bump @typescript-eslint/parser from 6.4.0 to 6.4.1 (#654)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.4.0 to 6.4.1.
- [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/v6.4.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  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>
2023-08-23 15:51:34 +02:00
dependabot[bot]
5ae53a98f4 Bump @typescript-eslint/parser from 6.3.0 to 6.4.0 (#650)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.3.0 to 6.4.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/v6.4.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-16 11:52:44 +02:00
dependabot[bot]
3ee17b5bb8 Bump prettier from 3.0.1 to 3.0.2 (#651)
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.1 to 3.0.2.
- [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/3.0.1...3.0.2)

---
updated-dependencies:
- dependency-name: prettier
  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>
2023-08-16 11:38:12 +02:00
dependabot[bot]
0c69b1fb2d Bump @typescript-eslint/eslint-plugin from 6.3.0 to 6.4.0 (#649)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.3.0 to 6.4.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/v6.4.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-16 11:36:28 +02:00
dependabot[bot]
46b10999d9 Bump eslint from 8.46.0 to 8.47.0 (#648)
Bumps [eslint](https://github.com/eslint/eslint) from 8.46.0 to 8.47.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.46.0...v8.47.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>
2023-08-15 13:17:33 +02:00
dependabot[bot]
e4e046fbf8 Bump @typescript-eslint/parser from 6.2.1 to 6.3.0 (#644)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.2.1 to 6.3.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/v6.3.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-09 10:27:10 +02:00
dependabot[bot]
3a11e77e22 Bump @typescript-eslint/eslint-plugin from 6.2.1 to 6.3.0 (#643)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.2.1 to 6.3.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/v6.3.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-09 10:23:21 +02:00
dependabot[bot]
0807891f38 Bump eslint-config-prettier from 8.9.0 to 8.10.0 (#640)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.9.0 to 8.10.0.
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.9.0...v8.10.0)

---
updated-dependencies:
- dependency-name: eslint-config-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>
2023-08-04 09:35:50 +02:00
dependabot[bot]
41bb6cf646 Bump prettier from 3.0.0 to 3.0.1 (#639)
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.0 to 3.0.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/3.0.0...3.0.1)

---
updated-dependencies:
- dependency-name: prettier
  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>
2023-08-04 09:33:04 +02:00
dependabot[bot]
01042f3ad7 Bump @typescript-eslint/parser from 6.1.0 to 6.2.1 (#636)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.1.0 to 6.2.1.
- [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/v6.2.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>
2023-08-02 15:59:37 +02:00
dependabot[bot]
e3f446034f Bump @typescript-eslint/eslint-plugin from 6.1.0 to 6.2.1 (#637)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.1.0 to 6.2.1.
- [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/v6.2.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>
2023-08-02 15:54:29 +02:00
Nikolai Laevskii
c40a0983dc Update bild 2023-08-02 06:53:28 +02:00
Nikolai Laevskii
bebba55950 Merge branch 'main' into v4-general-refactoring 2023-08-02 06:25:30 +02:00
Nikolai Laevskii
3b7f505149 General refactoring 2023-08-02 06:13:14 +02:00
TrianguloY
5bb656d641 Fix double negation message typo (#629)
* Fix double negation typo

* Rebuild index.js
2023-07-31 14:42:10 +02:00
임성호
c3a5749d46 Fix readme (#630) 2023-07-31 14:40:58 +02:00
dependabot[bot]
b2180b4a4b Bump eslint from 8.45.0 to 8.46.0 (#633)
Bumps [eslint](https://github.com/eslint/eslint) from 8.45.0 to 8.46.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.45.0...v8.46.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>
2023-07-31 12:28:34 +02:00
dependabot[bot]
4f68989491 Bump @typescript-eslint/eslint-plugin from 5.61.0 to 6.1.0 (#621) 2023-07-31 12:23:58 +02:00
dependabot[bot]
b657d45124 Bump prettier from 2.8.8 to 3.0.0 (#607) 2023-07-31 12:23:43 +02:00
dependabot[bot]
fbba7c5cc1 Bump eslint-config-prettier from 8.8.0 to 8.9.0 (#631)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.8.0 to 8.9.0.
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.8.0...v8.9.0)

---
updated-dependencies:
- dependency-name: eslint-config-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>
2023-07-31 10:59:15 +02:00
Dusan Trickovic
68124ad53a Update Minimatch to 9.0.3, rebuild and fix licensing (#626) 2023-07-26 13:23:55 +02:00
dependabot[bot]
3cc2196fe8 Bump eslint from 8.44.0 to 8.45.0 (#622)
Bumps [eslint](https://github.com/eslint/eslint) from 8.44.0 to 8.45.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.44.0...v8.45.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>
2023-07-24 16:51:56 +02:00
dependabot[bot]
6d6995cc8a Bump word-wrap from 1.2.3 to 1.2.4 (#623)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-24 16:51:10 +02:00
dependabot[bot]
ab39889de0 Bump eslint-plugin-jest from 27.2.2 to 27.2.3 (#620)
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 27.2.2 to 27.2.3.
- [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/v27.2.2...v27.2.3)

---
updated-dependencies:
- dependency-name: eslint-plugin-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>
2023-07-18 16:35:37 +02:00
dependabot[bot]
6fe6672296 Bump @typescript-eslint/parser from 5.61.0 to 5.62.0 (#615)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.61.0 to 5.62.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.62.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-12 10:43:46 +02:00
MaksimZhukov
e482ff4263 Update the README (#612)
* Update the README

* Remove extra spaces

* Remove extra space
2023-07-11 14:59:31 +02:00
Eric Cornelissen
b3ae1bded7 Make jest-each a devDependency (#611)
* Make `jest-each` a devDependency

Change the dependency on `jest-each` from a regular dependency to a
development dependency (devDependency) as it is only used in tests.

* Remove `jest-each` and use `test-each` instead
2023-07-11 14:57:50 +02:00
MaksimZhukov
4f052778de Merge pull request #574 from MaksimZhukov/v5.0.0-beta.1
fix: correct reading of sync-labels input
2023-05-24 13:03:28 +02:00
MaksimZhukov
26342ba349 fix: correct reading of sync-labels input 2023-05-24 12:21:33 +02:00
MaksimZhukov
e1fcf6fe5b Merge pull request #203 from joshdales/main
Assigns labels based on branch names
2023-05-24 12:01:55 +02:00
Josh Dales
3352df1f2b Bring test I accidently deleted 2023-05-17 07:26:44 -04:00
Josh Dales
57d34076e0 Better check for empty configs in checkAll 2023-05-17 07:05:19 -04:00
Josh Dales
a256a58edf Add check for empty objects in checkAll 2023-05-15 10:45:56 -04:00
Josh Dales
a5bed11d4d Run the build command 2023-05-11 17:02:27 -04:00
Josh Dales
4ac17648a4 Add a guard clause to stop false changed-files positives 2023-05-11 17:02:05 -04:00
Josh Dales
34a5bf6e83 Update the validation when there are no options in the matchConfigs 2023-05-11 17:01:46 -04:00
Josh Dales
09645fd40d Move the allowed Matchconfig keys into a constant 2023-05-11 16:37:58 -04:00
Josh Dales
51cc5e079c Update text in test descriptions and logging
Co-authored-by: MaksimZhukov <46996400+MaksimZhukov@users.noreply.github.com>
2023-05-11 16:35:05 -04:00
Josh Dales
9cfddd0144 Consolidate the new any change files test into the old one 2023-05-05 09:05:40 -04:00
Josh Dales
3aa0d436e5 Better test description 2023-05-05 09:02:53 -04:00
Josh Dales
9488def29a Update tests and build 2023-05-05 08:58:23 -04:00
Josh Dales
11812c37f6 Revert "Have a single isMatch for checking changed files"
This reverts commit d4d4a104a2.
2023-05-05 08:56:09 -04:00
Josh Dales
68a2598016 Merge branch 'actions:main' into main 2023-04-13 16:07:45 -04:00
Josh Dales
13e75b4361 minor update to the readme 2023-04-13 15:20:47 -04:00
Josh Dales
2a3422a64e Better description for the new test 2023-04-13 15:15:10 -04:00
Josh Dales
c1b0ca76ee Run the build command 2023-04-13 15:02:40 -04:00
Josh Dales
2637d23bca Add test for when not all globs match any changed file 2023-04-13 14:58:52 -04:00
Josh Dales
d4d4a104a2 Have a single isMatch for checking changed files 2023-04-13 14:38:41 -04:00
Josh Dales
7f169bc0f2 Merge pull request #4 from joshdales/another-config-setup
Change the structure of the config
2023-03-27 17:25:27 -04:00
Josh Dales
2f1dfd1ef0 Adjust the indenting again 2023-03-27 17:15:14 -04:00
Josh Dales
b1a2f85ed8 Update debugging indentation on the branch checks 2023-03-27 16:37:55 -04:00
Josh Dales
67604ee822 Update more debugging statements 2023-03-27 16:26:58 -04:00
Josh Dales
4be192c7d6 Run the build command 2023-03-27 16:23:04 -04:00
Josh Dales
3ddce51a65 Update the debug values 2023-03-27 16:15:03 -04:00
Josh Dales
938f9c9893 Update the readme a little more 2023-03-26 09:46:29 -04:00
Josh Dales
210043eed1 Run the build command 2023-03-25 19:09:30 -04:00
Josh Dales
fa7f98c785 Yikes, still missed that 2023-03-25 19:09:06 -04:00
Josh Dales
29382eb4ff Build command 2023-03-25 17:42:44 -04:00
Josh Dales
0b2cfb01d7 Im an idiot, bad copy pasta 2023-03-25 17:42:17 -04:00
Josh Dales
62f22bdebe Run the build command 2023-03-25 17:24:52 -04:00
Josh Dales
ef6ab1b64a Add function for checking if any path matches 2023-03-25 17:22:04 -04:00
Josh Dales
5ac9519cbf Update the README 2023-03-25 16:31:45 -04:00
Josh Dales
4554c0d1af Add a bunch more tests 2023-03-25 16:07:56 -04:00
Josh Dales
49676461cb Run the build command 2023-03-24 22:29:57 -04:00
Josh Dales
432b275f71 Get all the tests passings 2023-03-24 22:29:41 -04:00
Josh Dales
3bec9227d1 Add any and all functions for both checks 2023-03-24 21:51:33 -04:00
Josh Dales
a9e07ce8ff Add some new tests 2023-03-24 21:23:51 -04:00
Josh Dales
e51b118725 Change the structure of the config 2023-03-24 21:08:59 -04:00
Josh Dales
5d0a66ed59 Run the build command again 2023-03-23 09:09:29 -04:00
Josh Dales
9bfc9998ab Run build and fix bad merge 2023-03-23 09:08:08 -04:00
Josh Dales
8e6367ddee Merge branch 'main' into main 2023-03-23 09:02:46 -04:00
Josh Dales
1c9c27e128 Run the build command 2023-03-20 21:53:16 -04:00
Josh Dales
b25e3a8c27 Better wording for the new test 2023-03-20 17:51:58 -04:00
Josh Dales
d31255f7be Make sure that empty config options don't accidently label things 2023-03-20 17:40:28 -04:00
Josh Dales
92990c0c57 Don't allow empty changed-files objects through 2023-03-20 17:40:28 -04:00
Josh Dales
d0d3628020 Add extra tests and use toEqual matcher.
Turns out that toMatchObject would allow extra properties through
2023-03-20 17:40:28 -04:00
Josh Dales
cc1e02580b Update object assignment in toChangedFilesMatchConfig 2023-03-20 17:40:28 -04:00
Josh Dales
64ce5e9235 Update README with better description for branches
Co-authored-by: MaksimZhukov <46996400+MaksimZhukov@users.noreply.github.com>
2023-03-20 15:38:14 -04:00
Josh Dales
7741e57c6a Run the build command 2023-03-18 17:16:58 -04:00
Josh Dales
65b7640e45 Add unit tests for toMatchConfig 2023-03-18 17:15:18 -04:00
Josh Dales
e9a1777eb0 Fix linting and formatting 2023-03-18 16:46:54 -04:00
Josh Dales
17694aa238 Update the argument type for toMatchConfig 2023-03-18 16:44:50 -04:00
Josh Dales
c31ee1fd86 Add more unit tests for changedFiles.ts 2023-03-18 16:44:50 -04:00
Josh Dales
3af9a47a26 Add unit tests for toChangedFilesMatchConfig 2023-03-18 16:44:49 -04:00
Josh Dales
a988f4eb9d Add todo tests for changedFiles 2023-03-18 16:44:49 -04:00
Josh Dales
ef108a9d83 Convert the yaml output to a matchConfig in getLabelConfigMapFromObject 2023-03-18 16:44:49 -04:00
Josh Dales
1ce9b356f6 Move all changedFiles logic into it's own file 2023-03-18 16:44:49 -04:00
Josh Dales
9f259ee115 Rename checkGlobs to checkMatchConfigs and check each property 2023-03-18 16:44:49 -04:00
Josh Dales
c08f5faa12 Condense assignment of further config options in toChangedFilesMatchConfig 2023-03-18 16:44:49 -04:00
Josh Dales
51b763cbf2 Update comments in getMatchConfigs to represent updated types 2023-03-18 16:44:49 -04:00
Josh Dales
e939550344 Simplfy the conditions in toBranchMatchConfig 2023-03-18 16:44:49 -04:00
Josh Dales
e4486e9ed9 Throw an error if the config is the wrong type 2023-03-18 16:44:49 -04:00
Josh Dales
fc5eb711b0 Revert "reverse the conditions of checkMatch"
This reverts commit 0eb9d49330.
2023-03-18 16:44:49 -04:00
Josh Dales
3eec5d8ccc Update the syntax for checking a match 2023-03-18 16:44:49 -04:00
Josh Dales
90ef37079a Merge branch 'actions:main' into main 2023-03-18 16:44:40 -04:00
Josh Dales
f40b38734d Correct errors and typos in the README
Co-authored-by: Ivan <98037481+IvanZosimov@users.noreply.github.com>
2023-03-17 17:14:59 -04:00
Josh Dales
84e83a9b19 Merge branch 'main' into main 2023-03-08 18:10:37 -05:00
Josh Dales
5e6bdf6d89 update the example workflow in the readme 2023-03-03 11:17:10 -05:00
Josh Dales
394a01bde3 Make getBranchName argument non-optional 2023-03-03 11:15:48 -05:00
Josh Dales
2a5bc55cbf Fix bad test descriptions
Co-authored-by: MaksimZhukov <46996400+MaksimZhukov@users.noreply.github.com>
2023-03-03 09:28:40 -05:00
Josh Dales
2e10ffb6ec Reference minimatch in docs
Co-authored-by: MaksimZhukov <46996400+MaksimZhukov@users.noreply.github.com>
2023-03-03 09:26:43 -05:00
Josh Dales
e5b1bddf5e Update the README with documentation about the new config structure 2023-02-21 11:51:45 -05:00
Josh Dales
8943ca20c9 Merge pull request #3 from joshdales/new-config-structure 2023-02-21 08:38:50 -05:00
Josh Dales
56347d54a1 Add unit tests for toBranchMatchConfig 2023-02-21 08:30:24 -05:00
Josh Dales
da83a1845f Make sure that the changed files config values are an array 2023-02-19 18:10:19 -05:00
Josh Dales
ed31b27f2e Rename some functions and variables to match what they are doing 2023-02-19 16:46:14 -05:00
Josh Dales
09f085373a Fix some typos in the branch checks 2023-02-19 12:17:15 -05:00
Josh Dales
0eb9d49330 reverse the conditions of checkMatch 2023-01-29 15:58:23 -05:00
Josh Dales
b071d82cb8 Run the build command 2023-01-29 15:09:44 -05:00
Josh Dales
7d175313b7 Update the labeler tests 2023-01-29 15:09:06 -05:00
Josh Dales
969899da68 Add the changedFiles key and update logic in labeler 2023-01-29 14:10:07 -05:00
Josh Dales
7a5c525049 Create new interfaces for MatchConfig 2023-01-28 23:14:53 -05:00
Josh Dales
922ffdf5ad Remove deprecated IMinimatch import from labeler.ts 2023-01-28 22:43:56 -05:00
Josh Dales
231de6bc24 Remove the branch option and replace with just head-branch and base-branch 2023-01-28 22:30:05 -05:00
Josh Dales
2daf35ae4b Add an extra test now that we can check the base branch 2023-01-28 18:08:48 -05:00
Josh Dales
0b6e68d75a Add options for getting the head or base branch 2023-01-28 17:57:52 -05:00
Josh Dales
cd3a8df80d Create a test file for branch 2023-01-28 16:45:29 -05:00
Josh Dales
2343710777 Move all the branch checking into its own file 2023-01-28 15:58:00 -05:00
Josh Dales
f2b2513f41 Update the matching to use a regexp rather than minimatch 2023-01-28 15:34:31 -05:00
Josh Dales
8c59eccb9d Rename the getBranchName helper 2023-01-28 15:14:15 -05:00
Josh Dales
7b1327b4c4 Run the build command 2023-01-11 17:12:22 -05:00
Josh Dales
c54c5a2057 Run prettier 2023-01-11 17:09:44 -05:00
Josh Dales
7f8d8e472d Merge branch 'main' into main 2023-01-11 17:02:22 -05:00
Josh Dales
4c74e84461 Fix typo in the README 2022-09-22 09:05:46 -04:00
Josh Dales
0861fa5acc Run the build command 2022-08-30 17:24:00 -04:00
Josh Dales
0ad789cf22 Merge branch 'main' into main 2022-08-29 20:37:19 -04:00
Josh Dales
6e276063fe Update README with reference to branch options 2022-06-11 13:28:58 -04:00
Josh Dales
818399d10f Merge branch 'main' into main 2022-06-11 07:30:44 -04:00
Josh Dales
71fc664414 run the build script 2021-10-28 22:34:51 -04:00
Josh Dales
7aadc17f94 Update the tests for applying multiple branch based labels 2021-10-28 22:33:25 -04:00
Josh Dales
89f6b77325 minor adjustment for successful branch matching.
To better follow the any convention as opposed to all
2021-10-28 22:13:56 -04:00
Josh Dales
2246b667c6 Run build 2021-09-29 10:33:07 -04:00
Josh Dales
ab49f7a2bd Add tests for array branh labelling 2021-09-29 10:32:05 -04:00
Josh Dales
2d63815c83 Allow branch config to be an array as well 2021-09-29 10:31:50 -04:00
Josh Dales
76242143df Merge pull request #1 from bentohq/fix-branch-labeler 2021-09-16 18:40:19 -04:00
Amiel Martin
27a1d89941 Update src/labeler.ts
Safer access of pull_request data.

Co-authored-by: Josh Dales <30500472+joshdales@users.noreply.github.com>
2021-09-16 12:22:00 -08:00
Amiel Martin
79c0cc7c0b Include a test for branching 2021-09-15 10:14:24 -08:00
Amiel Martin
d9ed3e87f6 Format 2021-09-15 09:58:18 -08:00
Amiel Martin
2ced1f3255 Run build 2021-09-15 09:24:05 -08:00
Amiel Martin
cb5f4480b2 Use correct branch name and update tests 2021-09-15 09:23:41 -08:00
Amiel Martin
8aa7614bc1 Run build 2021-09-15 09:16:56 -08:00
Amiel Martin
827e1186a2 Fix PR branch labeler 2021-09-15 09:05:10 -08:00
Josh Dales
765934f274 Run build 2021-08-07 15:26:22 -04:00
Josh Dales
bce88a9ea3 Update new test description 2021-08-07 15:26:13 -04:00
Josh Dales
a01b9aebb2 Add another test to make sure that partial branch naming works 2021-08-07 15:20:20 -04:00
Josh Dales
ee0e0eb513 Add a new fixture and test for the branch checking 2021-08-07 15:12:02 -04:00
Josh Dales
6c50d09410 include checkBranch in checkMatch 2021-08-07 15:09:15 -04:00
Josh Dales
ad73546cad Add function for checking branches 2021-08-07 15:07:47 -04:00
Josh Dales
2bf42e445d Add branch to MatchConfig interface 2021-08-07 15:06:24 -04:00
81 changed files with 35538 additions and 14807 deletions

View File

@@ -15,3 +15,5 @@ jobs:
call-basic-validation:
name: Basic validation
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
with:
node-version: '24.x'

View File

@@ -15,3 +15,5 @@ jobs:
call-check-dist:
name: Check dist/
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
with:
node-version: '24.x'

View File

@@ -0,0 +1,20 @@
name: 'Publish Immutable Action Version'
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checking out
uses: actions/checkout@v5
- name: Publish
id: publish
uses: actions/publish-immutable-action@0.0.3

View File

@@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Update the ${{ env.TAG_NAME }} tag
uses: actions/publish-action@v0.2.2
uses: actions/publish-action@v0.4.0
with:
source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}

View File

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

View File

@@ -1,15 +1,16 @@
---
name: color-name
version: 1.1.4
name: "@actions/exec"
version: 1.1.1
type: npm
summary: A list of color names and its values
homepage: https://github.com/colorjs/color-name
summary: Actions exec lib
homepage: https://github.com/actions/toolkit/tree/main/packages/exec
license: mit
licenses:
- sources: LICENSE
- sources: LICENSE.md
text: |-
The MIT License (MIT)
Copyright (c) 2015 Dmitry Ivanov
Copyright 2019 GitHub
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:

View File

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

View File

@@ -1,6 +1,6 @@
---
name: "@actions/http-client"
version: 2.0.1
version: 2.2.0
type: npm
summary: Actions Http Client
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client

View File

@@ -1,16 +1,16 @@
---
name: uuid
version: 8.3.2
name: "@actions/io"
version: 1.1.3
type: npm
summary: RFC4122 (v1, v4, and v5) UUIDs
homepage:
summary: Actions io lib
homepage: https://github.com/actions/toolkit/tree/main/packages/io
license: mit
licenses:
- sources: LICENSE.md
text: |
text: |-
The MIT License (MIT)
Copyright (c) 2010-2020 Robert Kieffer and other contributors
Copyright 2019 GitHub
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:

View File

@@ -1,22 +1,20 @@
---
name: "@octokit/request-error"
version: 2.1.0
name: "@fastify/busboy"
version: 2.0.0
type: npm
summary: Error class for Octokit request errors
summary: A streaming parser for HTML form data for node.js
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License
Copyright (c) 2019 Octokit contributors
text: |-
Copyright Brian White. All rights reserved.
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
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
@@ -26,9 +24,7 @@ licenses:
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)"
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,32 +0,0 @@
---
name: "@jest/schemas"
version: 29.6.0
type: npm
summary:
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
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,32 +0,0 @@
---
name: "@jest/types"
version: 29.6.1
type: npm
summary:
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
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: "@octokit/auth-token"
version: 2.5.0
version: 4.0.0
type: npm
summary: GitHub API token authentication for browsers and Node.js
homepage:

View File

@@ -1,6 +1,6 @@
---
name: "@octokit/core"
version: 3.6.0
version: 5.0.1
type: npm
summary: Extendable client for GitHub's REST & GraphQL APIs
homepage:

View File

@@ -1,6 +1,6 @@
---
name: "@octokit/endpoint"
version: 6.0.12
version: 9.0.1
type: npm
summary: Turns REST API endpoints into generic request options
homepage:

View File

@@ -1,6 +1,6 @@
---
name: "@octokit/graphql"
version: 4.8.0
version: 7.0.2
type: npm
summary: GitHub GraphQL API client for browsers and Node
homepage:

View File

@@ -1,6 +1,6 @@
---
name: "@octokit/openapi-types"
version: 12.11.0
version: 19.0.1
type: npm
summary: Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com
homepage:

View File

@@ -1,6 +1,6 @@
---
name: "@octokit/openapi-types"
version: 18.0.0
version: 23.0.1
type: npm
summary: Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com
homepage:

View File

@@ -1,6 +1,6 @@
---
name: "@octokit/plugin-paginate-rest"
version: 2.21.3
version: 9.1.0
type: npm
summary: Octokit plugin to paginate REST API endpoint responses
homepage:

View File

@@ -1,6 +1,6 @@
---
name: "@octokit/plugin-rest-endpoint-methods"
version: 5.16.2
version: 10.1.0
type: npm
summary: Octokit plugin adding one method for all of api.github.com REST API endpoints
homepage:

View File

@@ -1,6 +1,6 @@
---
name: "@octokit/plugin-retry"
version: 5.0.5
version: 6.0.1
type: npm
summary: Automatic retry plugin for octokit
homepage:

View File

@@ -1,6 +1,6 @@
---
name: "@octokit/request-error"
version: 4.0.2
version: 5.1.1
type: npm
summary: Error class for Octokit request errors
homepage:

View File

@@ -1,6 +1,6 @@
---
name: "@octokit/request"
version: 5.6.3
version: 8.1.4
type: npm
summary: Send parameterized requests to GitHub's APIs with sensible defaults in browsers
and Node

View File

@@ -1,6 +1,6 @@
---
name: "@octokit/types"
version: 6.41.0
version: 12.1.0
type: npm
summary: Shared TypeScript definitions for Octokit projects
homepage:

View File

@@ -1,6 +1,6 @@
---
name: "@octokit/types"
version: 10.0.0
version: 13.8.0
type: npm
summary: Shared TypeScript definitions for Octokit projects
homepage:

View File

@@ -1,26 +0,0 @@
---
name: "@sinclair/typebox"
version: 0.27.8
type: npm
summary: JSONSchema Type Builder with Static Type Resolution for TypeScript
homepage:
license: mit
licenses:
- sources: license
text: "TypeBox: JSON Schema Type Builder with Static Type Resolution for TypeScript
\n\nThe MIT License (MIT)\n\nCopyright (c) 2017-2023 Haydn Paterson (sinclair)
<haydn.developer@gmail.com>\n\nPermission is hereby granted, free of charge, to
any person obtaining a copy\nof this software and associated documentation files
(the \"Software\"), to deal\nin the Software without restriction, including without
limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense,
and/or sell\ncopies of the Software, and to permit persons to whom the Software
is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright
notice and this permission notice shall be included in\nall copies or substantial
portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY
OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN\nTHE SOFTWARE."
notices: []

View File

@@ -1,32 +0,0 @@
---
name: "@types/istanbul-lib-coverage"
version: 2.0.4
type: npm
summary: TypeScript definitions for istanbul-lib-coverage
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-lib-coverage
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,32 +0,0 @@
---
name: "@types/istanbul-lib-report"
version: 3.0.0
type: npm
summary: TypeScript definitions for istanbul-lib-report
homepage:
license: mit
licenses:
- sources: LICENSE
text: |2
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
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,32 +0,0 @@
---
name: "@types/istanbul-reports"
version: 3.0.1
type: npm
summary: TypeScript definitions for istanbul-reports
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-reports
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,32 +0,0 @@
---
name: "@types/node"
version: 16.18.11
type: npm
summary: TypeScript definitions for Node.js
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
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,32 +0,0 @@
---
name: "@types/yargs-parser"
version: 21.0.0
type: npm
summary: TypeScript definitions for yargs-parser
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs-parser
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,32 +0,0 @@
---
name: "@types/yargs"
version: 17.0.24
type: npm
summary: TypeScript definitions for yargs
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs
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,20 +0,0 @@
---
name: ansi-styles
version: 4.3.0
type: npm
summary: ANSI escape codes for styling strings in the terminal
homepage:
license: mit
licenses:
- sources: license
text: |
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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,20 +0,0 @@
---
name: ansi-styles
version: 5.2.0
type: npm
summary: ANSI escape codes for styling strings in the terminal
homepage:
license: mit
licenses:
- sources: license
text: |
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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: brace-expansion
version: 2.0.1
version: 2.0.2
type: npm
summary: Brace expansion as known from sh/bash
homepage: https://github.com/juliangruber/brace-expansion

View File

@@ -1,20 +0,0 @@
---
name: chalk
version: 4.1.2
type: npm
summary: Terminal string styling done right
homepage:
license: mit
licenses:
- sources: license
text: |
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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,34 +0,0 @@
---
name: ci-info
version: 3.7.1
type: npm
summary: Get details about the current Continuous Integration environment
homepage: https://github.com/watson/ci-info
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2016-2023 Thomas Watson Steen
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,26 +0,0 @@
---
name: graceful-fs
version: 4.2.10
type: npm
summary: A drop-in replacement for fs, making various improvements.
homepage:
license: isc
licenses:
- sources: LICENSE
text: |
The ISC License
Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, 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,22 +0,0 @@
---
name: has-flag
version: 4.0.0
type: npm
summary: Check if argv has a specific flag
homepage:
license: mit
licenses:
- sources: license
text: |
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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 © [Sindre Sorhus](https://sindresorhus.com)
notices: []

View File

@@ -1,32 +0,0 @@
---
name: jest-get-type
version: 29.4.3
type: npm
summary: A utility function to get the type of a value
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
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,32 +0,0 @@
---
name: jest-util
version: 29.6.1
type: npm
summary:
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
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,14 +1,26 @@
---
name: color-convert
version: 2.0.1
name: lodash.isequal
version: 4.5.0
type: npm
summary: Plain color conversion functions
homepage:
summary: The Lodash method `_.isEqual` exported as a module.
homepage: https://lodash.com/
license: mit
licenses:
- sources: LICENSE
text: |+
Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.com>
text: |
Copyright JS Foundation and other contributors <https://js.foundation/>
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
@@ -29,7 +41,18 @@ licenses:
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: Copyright &copy; 2011-2016, Heather Arthur and Josh Junon. Licensed under
the [MIT License](LICENSE).
====
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: []

View File

@@ -1,6 +1,6 @@
---
name: minimatch
version: 7.4.3
version: 10.0.1
type: npm
summary: a glob matcher in javascript
homepage:

View File

@@ -1,56 +0,0 @@
---
name: node-fetch
version: 2.6.7
type: npm
summary: A light-weight module that brings window.fetch to node.js
homepage: https://github.com/bitinn/node-fetch
license: mit
licenses:
- sources: LICENSE.md
text: |+
The MIT License (MIT)
Copyright (c) 2016 David Frank
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
[npm-image]: https://flat.badgen.net/npm/v/node-fetch
[npm-url]: https://www.npmjs.com/package/node-fetch
[travis-image]: https://flat.badgen.net/travis/bitinn/node-fetch
[travis-url]: https://travis-ci.org/bitinn/node-fetch
[codecov-image]: https://flat.badgen.net/codecov/c/github/bitinn/node-fetch/master
[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
[mdn-headers]: https://developer.mozilla.org/en-US/docs/Web/API/Headers
[LIMITS.md]: https://github.com/bitinn/node-fetch/blob/master/LIMITS.md
[ERROR-HANDLING.md]: https://github.com/bitinn/node-fetch/blob/master/ERROR-HANDLING.md
[UPGRADE-GUIDE.md]: https://github.com/bitinn/node-fetch/blob/master/UPGRADE-GUIDE.md
notices: []

View File

@@ -1,38 +0,0 @@
---
name: picomatch
version: 2.3.1
type: npm
summary: Blazing fast and accurate glob matcher written in JavaScript, with no dependencies
and full support for standard and extended Bash glob features, including braces,
extglobs, POSIX brackets, and regular expressions.
homepage: https://github.com/micromatch/picomatch
license: mit
licenses:
- sources: LICENSE
text: |
The MIT License (MIT)
Copyright (c) 2017-present, Jon Schlinkert.
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: |-
Copyright © 2017-present, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
notices: []

View File

@@ -1,32 +0,0 @@
---
name: pretty-format
version: 29.6.1
type: npm
summary: Stringify any JavaScript value.
homepage:
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
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,32 +0,0 @@
---
name: react-is
version: 18.2.0
type: npm
summary: Brand checking of React Elements.
homepage: https://reactjs.org/
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) Facebook, Inc. and its affiliates.
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,20 +0,0 @@
---
name: supports-color
version: 7.2.0
type: npm
summary: Detect whether a terminal supports color
homepage:
license: mit
licenses:
- sources: license
text: |
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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,30 +0,0 @@
---
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: []

View File

@@ -1,16 +1,16 @@
---
name: jest-each
version: 29.6.1
name: undici
version: 5.29.0
type: npm
summary: Parameterised tests for Jest
homepage:
summary: An HTTP/1.1 client, written from scratch for Node.js
homepage: https://undici.nodejs.org
license: mit
licenses:
- sources: LICENSE
text: |
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright (c) Matteo Collina and Undici 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

View File

@@ -1,23 +0,0 @@
---
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: []

View File

@@ -1,32 +0,0 @@
---
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: []

292
README.md
View File

@@ -2,104 +2,160 @@
[![Basic validation](https://github.com/actions/labeler/actions/workflows/basic-validation.yml/badge.svg?branch=main)](https://github.com/actions/labeler/actions/workflows/basic-validation.yml)
Automatically label new pull requests based on the paths of files being changed.
Automatically label new pull requests based on the paths of files being changed or the branch name.
## Breaking changes in V6
- Upgraded action from node20 to node24.
> Make sure your runner is on version v2.327.1 or later to ensure compatibility with this release. [Release Notes](https://github.com/actions/runner/releases/tag/v2.327.1)
For more details, see the full release notes on the [release page](https://github.com/actions/labeler/releases/tag/v6.0.0)
## Breaking changes in V5
1) The ability to apply labels based on the names of base and/or head branches was added ([#186](https://github.com/actions/labeler/issues/186) and [#54](https://github.com/actions/labeler/issues/54)). The match object for changed files was expanded with new combinations in order to make it more intuitive and flexible ([#423](https://github.com/actions/labeler/issues/423) and [#101](https://github.com/actions/labeler/issues/101)). As a result, the configuration file structure was significantly redesigned and is not compatible with the structure of the previous version. Please read the documentation below to find out how to adapt your configuration files for use with the new action version.
2) The bug related to the `sync-labels` input was fixed ([#112](https://github.com/actions/labeler/issues/112)). Now the input value is read correctly.
3) By default, `dot` input is set to `true`. Now, paths starting with a dot (e.g. `.github`) are matched by default.
4) Version 5 of this action updated the [runtime to Node.js 20](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions). All scripts are now run with Node.js 20 instead of Node.js 16 and are affected by any breaking changes between Node.js 16 and 20.
> [!IMPORTANT]
> Before the update to the v5, please check out [this information](#notes-regarding-pull_request_target-event) about the `pull_request_target` event trigger.
## Usage
### Create `.github/labeler.yml`
Create a `.github/labeler.yml` file with a list of labels and [minimatch](https://github.com/isaacs/minimatch) globs to match to apply the label.
Create a `.github/labeler.yml` file with a list of labels and config options to match and apply the label.
The key is the name of the label in your repository that you want to add (e.g. `merge conflict`, `needs-updating`) and the value is the path (glob) of the changed files (e.g. `src/**`, `tests/*.spec.js`) or a match object.
The key is the name of the label in your repository that you want to add (eg: "merge conflict", "needs-updating") and the value is a match object.
#### Match Object
For more control over matching, you can provide a match object instead of a simple path glob. The match object is defined as:
The match object allows control over the matching options. You can specify the label to be applied based on the files that have changed or the name of either the base branch or the head branch. For the changed files options you provide a [path glob](https://github.com/isaacs/minimatch#minimatch), and for the branches you provide a regexp to match against the branch name.
The base match object is defined as:
```yml
- any: ['list', 'of', 'globs']
all: ['list', 'of', 'globs']
- changed-files:
- any-glob-to-any-file: ['list', 'of', 'globs']
- any-glob-to-all-files: ['list', 'of', 'globs']
- all-globs-to-any-file: ['list', 'of', 'globs']
- all-globs-to-all-files: ['list', 'of', 'globs']
- base-branch: ['list', 'of', 'regexps']
- head-branch: ['list', 'of', 'regexps']
```
One or both fields can be provided for fine-grained matching. Unlike the top-level list, the list of path globs provided to `any` and `all` must ALL match against a path for the label to be applied.
The fields are defined as follows:
* `any`: match ALL globs against ANY changed path
* `all`: match ALL globs against ALL changed paths
A simple path glob is the equivalent to `any: ['glob']`. More specifically, the following two configurations are equivalent:
There are two top-level keys, `any` and `all`, which both accept the same configuration options:
```yml
label1:
- example1/*
- any:
- changed-files:
- any-glob-to-any-file: ['list', 'of', 'globs']
- any-glob-to-all-files: ['list', 'of', 'globs']
- all-globs-to-any-file: ['list', 'of', 'globs']
- all-globs-to-all-files: ['list', 'of', 'globs']
- base-branch: ['list', 'of', 'regexps']
- head-branch: ['list', 'of', 'regexps']
- all:
- changed-files:
- any-glob-to-any-file: ['list', 'of', 'globs']
- any-glob-to-all-files: ['list', 'of', 'globs']
- all-globs-to-any-file: ['list', 'of', 'globs']
- all-globs-to-all-files: ['list', 'of', 'globs']
- base-branch: ['list', 'of', 'regexps']
- head-branch: ['list', 'of', 'regexps']
```
From a boolean logic perspective, top-level match objects, and options within `all` are `AND`-ed together and individual match rules within the `any` object are `OR`-ed.
One or all fields can be provided for fine-grained matching.
The fields are defined as follows:
- `all`: ALL of the provided options must match for the label to be applied
- `any`: if ANY of the provided options match then the label will be applied
- `base-branch`: match regexps against the base branch name
- `head-branch`: match regexps against the head branch name
- `changed-files`: match glob patterns against the changed paths
- `any-glob-to-any-file`: ANY glob must match against ANY changed file
- `any-glob-to-all-files`: ANY glob must match against ALL changed files
- `all-globs-to-any-file`: ALL globs must match against ANY changed file
- `all-globs-to-all-files`: ALL globs must match against ALL changed files
If a base option is provided without a top-level key, then it will default to `any`. More specifically, the following two configurations are equivalent:
```yml
Documentation:
- changed-files:
- any-glob-to-any-file: 'docs/*'
```
and
```yml
label1:
- any: ['example1/*']
Documentation:
- any:
- changed-files:
- any-glob-to-any-file: 'docs/*'
```
From a boolean logic perspective, top-level match objects are `OR`-ed together and individual match rules within an object are `AND`-ed. Combined with `!` negation, you can write complex matching rules.
> ⚠️ This action uses [minimatch](https://www.npmjs.com/package/minimatch) to apply glob patterns.
> For historical reasons, paths starting with dot (e.g. `.github`) are not matched by default.
> You need to set `dot: true` to change this behavior.
> See [Inputs](#inputs) table below for details.
If path globs are combined with `!` negation, you can write complex matching rules. See the examples below for more information.
#### Basic Examples
```yml
# Add 'label1' to any changes within 'example' folder or any subfolders
label1:
- example/**
# Add 'root' label to any root file changes
# Quotation marks are required for the leading asterisk
root:
- changed-files:
- any-glob-to-any-file: '*'
# Add 'label2' to any file changes within 'example2' folder
label2: example2/*
# Add 'AnyChange' label to any changes within the entire repository
AnyChange:
- changed-files:
- any-glob-to-any-file: '**'
# Add label3 to any change to .txt files within the entire repository. Quotation marks are required for the leading asterisk
label3:
- '**/*.txt'
# Add 'Documentation' label to any changes within 'docs' folder or any subfolders
Documentation:
- changed-files:
- any-glob-to-any-file: docs/**
```
# Add 'Documentation' label to any file changes within 'docs' folder
Documentation:
- changed-files:
- any-glob-to-any-file: docs/*
#### Common Examples
# Add 'Documentation' label to any file changes within 'docs' or 'guides' folders
Documentation:
- changed-files:
- any-glob-to-any-file:
- docs/*
- guides/*
```yml
# Add 'repo' label to any root file changes
repo:
- '*'
## Equivalent of the above mentioned configuration using another syntax
Documentation:
- changed-files:
- any-glob-to-any-file: ['docs/*', 'guides/*']
# Add '@domain/core' label to any change within the 'core' package
'@domain/core':
- package/core/**
# Add 'test' label to any change to *.spec.js files within the source dir
test:
- src/**/*.spec.js
# Add 'Documentation' label to any change to .md files within the entire repository
Documentation:
- changed-files:
- any-glob-to-any-file: '**/*.md'
# Add 'source' label to any change to src files within the source dir EXCEPT for the docs sub-folder
source:
- any: ['src/**', '!src/docs/*']
- all:
- changed-files:
- any-glob-to-any-file: 'src/**/*'
- all-globs-to-all-files: '!src/docs/*'
# Add 'frontend` label to any change to *.js files as long as the `main.js` hasn't changed
frontend:
- any: ['src/**/*.js']
all: ['!src/main.js']
# Add 'feature' label to any PR where the head branch name starts with `feature` or has a `feature` section in the name
feature:
- head-branch: ['^feature', 'feature']
# Add the 'AnyChange' label to any changes within the entire repository if the 'dot' option is set to 'false'
AnyChange:
- '**'
- '**/.*'
- '**/.*/**'
- '**/.*/**/.*'
# Add the 'AnyChange' label to any changes within the entire repository if the 'dot' option is set to 'true'
AnyChange:
- '**'
# Add 'release' label to any PR that is opened against the `main` branch
release:
- base-branch: 'main'
```
### Create Workflow
Create a workflow (e.g. `.github/workflows/labeler.yml` see [Creating a Workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file)) to utilize the labeler action with content:
Create a workflow (e.g. `.github/workflows/labeler.yml` see [Creating a Workflow file](https://docs.github.com/en/actions/writing-workflows/quickstart#creating-your-first-workflow)) to utilize the labeler action with content:
```yml
name: "Pull Request Labeler"
@@ -107,13 +163,13 @@ on:
- pull_request_target
jobs:
triage:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v6
```
#### Inputs
@@ -122,10 +178,10 @@ Various inputs are defined in [`action.yml`](action.yml) to let you configure th
| Name | Description | Default |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| `repo-token` | Token to use to authorize label changes. Typically the GITHUB_TOKEN secret | N/A |
| `repo-token` | Token to use to authorize label changes. Typically the GITHUB_TOKEN secret | `github.token` |
| `configuration-path` | The path to the label configuration file. If the file doesn't exist at the specified path on the runner, action will read from the source repository via the Github API. | `.github/labeler.yml` |
| `sync-labels` | Whether or not to remove labels when matching files are reverted or no longer changed by the PR | `false` |
| `dot` | Whether or not to auto-include paths starting with dot (e.g. `.github`) | `false` |
| `dot` | Whether or not to auto-include paths starting with dot (e.g. `.github`) | `true` |
| `pr-number` | The number(s) of pull request to update, rather than detecting from the workflow context | N/A |
##### Using `configuration-path` input together with the `@actions/checkout` action
@@ -133,30 +189,16 @@ You might want to use action called [@actions/checkout](https://github.com/actio
```yml
steps:
- uses: actions/checkout@v3 # Uploads repository content to the runner
- uses: actions/checkout@v5 # Uploads repository content to the runner
with:
repository: "owner/repositoryName" # The one of the available inputs, visit https://github.com/actions/checkout#readme to find more
- uses: actions/labeler@v4
- uses: actions/labeler@v6
with:
configuration-path: 'path/to/the/uploaded/configuration/file'
```
##### Peculiarities of using the `dot` input
When `dot` is disabled, and you want to include _all_ files in a folder:
```yml
label1:
- path/to/folder/**/*
- path/to/folder/**/.*
```
If `dot` is enabled:
```yml
label1:
- path/to/folder/**
```
##### Example workflow specifying Pull request numbers
##### Example workflow specifying pull request numbers
```yml
name: "Label Previous Pull Requests"
@@ -165,16 +207,15 @@ on:
- cron: "0 1 * * 1"
jobs:
triage:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
# Label PRs 1, 2, and 3
- uses: actions/labeler@v4
- uses: actions/labeler@v6
with:
pr-number: |
1
@@ -184,7 +225,6 @@ jobs:
**Note:** in normal usage the `pr-number` input is not required as the action will detect the PR number from the workflow context.
#### Outputs
Labeler provides the following outputs:
@@ -196,19 +236,19 @@ Labeler provides the following outputs:
The following example performs steps based on the output of labeler:
```yml
name: "My workflow"
name: "Pull Request Labeler"
on:
- pull_request_target
jobs:
triage:
runs-on: ubuntu-latest
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- id: label-the-PR
uses: actions/labeler@v4
uses: actions/labeler@v6
- id: run-frontend-tests
if: contains(steps.label-the-PR.outputs.all-labels, 'frontend')
@@ -223,23 +263,59 @@ jobs:
# Put your commands for running backend tests here
```
## Permissions
## Recommended Permissions
In order to add labels to pull requests, the GitHub labeler action requires
write permissions on the pull-request. However, when the action runs on a pull
request from a forked repository, GitHub only grants read access tokens for
`pull_request` events, at most. If you encounter an `Error: HttpError: Resource
not accessible by integration`, it's likely due to these permission constraints.
To resolve this issue, you can modify the `on:` section of your workflow to use
[`pull_request_target`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target)
instead of `pull_request` (see example [above](#create-workflow)). This change
allows the action to have write access, because `pull_request_target` alters the
[context of the
action](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target)
and safely grants additional permissions. Refer to the [GitHub token
permissions
documentation](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token)
for more details about access levels and event contexts.
To successfully add labels to pull requests using the GitHub Labeler Action, specific permissions must be granted based on your use case:
1. **Adding Existing Labels**:
- Requires: `pull-requests: write`
- Use this if all labels already exist in the repository (i.e., pre-defined in `.github/labeler.yml`).
2. **Creating New Labels**:
- Requires: `issues: write`
- This is necessary if the action needs to create labels that do not already exist in the repository.
However, when the action runs on a pull request from a forked repository, GitHub only grants read access tokens for `pull_request` events, at most. If you encounter an `Error: HttpError: Resource not accessible by integration`, it's likely due to these permission constraints. To resolve this issue, you can modify the `on:` section of your workflow to use
[`pull_request_target`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target) instead of `pull_request` (see example [above](#create-workflow)). This change allows the action to have write access, because `pull_request_target` alters the [context of the action](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target) and safely grants additional permissions.
There exists a potentially dangerous misuse of the `pull_request_target` workflow trigger that may lead to malicious PR authors (i.e. attackers) being able to obtain repository write permissions or stealing repository secrets. Hence, it is advisable that `pull_request_target` should only be used in workflows that are carefully designed to avoid executing untrusted code and to also ensure that workflows using `pull_request_target` limit access to sensitive resources. Refer to the [GitHub token permissions documentation](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token) for more details about access levels and event contexts.
### Example Workflow Permissions
To ensure the action works correctly, include the following permissions in your workflow file:
```yml
permissions:
contents: read
pull-requests: write
issues: write
```
### Manual Label Creation as an Alternative to Granting issues write Permission
If you prefer not to grant the `issues: write` permission in your workflow, you can manually create all required labels in the repository before the action runs.
## Notes regarding `pull_request_target` event
Using the `pull_request_target` event trigger involves several peculiarities related to initial set up of the labeler or updating version of the labeler.
### Initial set up of the labeler action
When submitting an initial pull request to a repository using the `pull_request_target` event, the labeler workflow will not run on that pull request because the `pull_request_target` execution runs off the base branch instead of the pull request's branch. Unfortunately this means the introduction of the labeler can not be verified during that pull request and it needs to be committed blindly.
### Updating major version of the labeler
When submitting a pull request that includes updates of the labeler action version and associated configuration files, using the `pull_request_target` event may result in a failed workflow. This is due to the nature of `pull_request_target`, which uses the code from the base branch rather than the branch linked to the pull request — so, potentially outdated configuration files may not be compatible with the updated labeler action.
To prevent this issue, you can switch to using the `pull_request` event temporarily, before merging. This event execution draws from the code within the branch of your pull request, allowing you to verify the new configuration's compatibility with the updated labeler action.
```yml
name: "Pull Request Labeler"
on:
- pull_request
```
Once you confirm that the updated configuration files function as intended, you can then revert to using the `pull_request_target` event before merging the pull request. Following this step ensures that your workflow is robust and free from disruptions.
## Contributions

View File

@@ -1,7 +1,13 @@
export const context = {
payload: {
pull_request: {
number: 123
number: 123,
head: {
ref: 'head-branch-name'
},
base: {
ref: 'base-branch-name'
}
}
},
repo: {

210
__tests__/branch.test.ts Normal file
View File

@@ -0,0 +1,210 @@
import {
getBranchName,
checkAnyBranch,
checkAllBranch,
toBranchMatchConfig,
BranchMatchConfig
} from '../src/branch';
import * as github from '@actions/github';
jest.mock('@actions/core');
jest.mock('@actions/github');
describe('getBranchName', () => {
describe('when the pull requests base branch is requested', () => {
it('returns the base branch name', () => {
const result = getBranchName('base');
expect(result).toEqual('base-branch-name');
});
});
describe('when the pull requests head branch is requested', () => {
it('returns the head branch name', () => {
const result = getBranchName('head');
expect(result).toEqual('head-branch-name');
});
});
});
describe('checkAllBranch', () => {
beforeEach(() => {
github.context.payload.pull_request!.head = {
ref: 'test/feature/123'
};
github.context.payload.pull_request!.base = {
ref: 'main'
};
});
describe('when a single pattern is provided', () => {
describe('and the pattern matches the head branch', () => {
it('returns true', () => {
const result = checkAllBranch(['^test'], 'head');
expect(result).toBe(true);
});
});
describe('and the pattern does not match the head branch', () => {
it('returns false', () => {
const result = checkAllBranch(['^feature/'], 'head');
expect(result).toBe(false);
});
});
});
describe('when multiple patterns are provided', () => {
describe('and not all patterns matched', () => {
it('returns false', () => {
const result = checkAllBranch(['^test/', '^feature/'], 'head');
expect(result).toBe(false);
});
});
describe('and all patterns match', () => {
it('returns true', () => {
const result = checkAllBranch(['^test/', '/feature/'], 'head');
expect(result).toBe(true);
});
});
describe('and no patterns match', () => {
it('returns false', () => {
const result = checkAllBranch(['^feature/', '/test$'], 'head');
expect(result).toBe(false);
});
});
});
describe('when the branch to check is specified as the base branch', () => {
describe('and the pattern matches the base branch', () => {
it('returns true', () => {
const result = checkAllBranch(['^main$'], 'base');
expect(result).toBe(true);
});
});
});
});
describe('checkAnyBranch', () => {
beforeEach(() => {
github.context.payload.pull_request!.head = {
ref: 'test/feature/123'
};
github.context.payload.pull_request!.base = {
ref: 'main'
};
});
describe('when a single pattern is provided', () => {
describe('and the pattern matches the head branch', () => {
it('returns true', () => {
const result = checkAnyBranch(['^test'], 'head');
expect(result).toBe(true);
});
});
describe('and the pattern does not match the head branch', () => {
it('returns false', () => {
const result = checkAnyBranch(['^feature/'], 'head');
expect(result).toBe(false);
});
});
});
describe('when multiple patterns are provided', () => {
describe('and at least one pattern matches', () => {
it('returns true', () => {
const result = checkAnyBranch(['^test/', '^feature/'], 'head');
expect(result).toBe(true);
});
});
describe('and all patterns match', () => {
it('returns true', () => {
const result = checkAnyBranch(['^test/', '/feature/'], 'head');
expect(result).toBe(true);
});
});
describe('and no patterns match', () => {
it('returns false', () => {
const result = checkAnyBranch(['^feature/', '/test$'], 'head');
expect(result).toBe(false);
});
});
});
describe('when the branch to check is specified as the base branch', () => {
describe('and the pattern matches the base branch', () => {
it('returns true', () => {
const result = checkAnyBranch(['^main$'], 'base');
expect(result).toBe(true);
});
});
});
});
describe('toBranchMatchConfig', () => {
describe('when there are no branch keys in the config', () => {
const config = {'changed-files': [{any: ['testing']}]};
it('returns an empty object', () => {
const result = toBranchMatchConfig(config);
expect(result).toEqual({});
});
});
describe('when the config contains a head-branch option', () => {
const config = {'head-branch': ['testing']};
it('sets headBranch in the matchConfig', () => {
const result = toBranchMatchConfig(config);
expect(result).toEqual<BranchMatchConfig>({
headBranch: ['testing']
});
});
describe('and the matching option is a string', () => {
const stringConfig = {'head-branch': 'testing'};
it('sets headBranch in the matchConfig', () => {
const result = toBranchMatchConfig(stringConfig);
expect(result).toEqual<BranchMatchConfig>({
headBranch: ['testing']
});
});
});
});
describe('when the config contains a base-branch option', () => {
const config = {'base-branch': ['testing']};
it('sets baseBranch in the matchConfig', () => {
const result = toBranchMatchConfig(config);
expect(result).toEqual<BranchMatchConfig>({
baseBranch: ['testing']
});
});
describe('and the matching option is a string', () => {
const stringConfig = {'base-branch': 'testing'};
it('sets baseBranch in the matchConfig', () => {
const result = toBranchMatchConfig(stringConfig);
expect(result).toEqual<BranchMatchConfig>({
baseBranch: ['testing']
});
});
});
});
describe('when the config contains both a base-branch and head-branch option', () => {
const config = {'base-branch': ['testing'], 'head-branch': ['testing']};
it('sets headBranch and baseBranch in the matchConfig', () => {
const result = toBranchMatchConfig(config);
expect(result).toEqual<BranchMatchConfig>({
baseBranch: ['testing'],
headBranch: ['testing']
});
});
});
});

View File

@@ -0,0 +1,270 @@
import {
ChangedFilesMatchConfig,
checkAllChangedFiles,
checkAnyChangedFiles,
toChangedFilesMatchConfig,
checkIfAnyGlobMatchesAnyFile,
checkIfAllGlobsMatchAnyFile,
checkIfAnyGlobMatchesAllFiles,
checkIfAllGlobsMatchAllFiles
} from '../src/changedFiles';
jest.mock('@actions/core');
jest.mock('@actions/github');
describe('checkAllChangedFiles', () => {
const changedFiles = ['foo.txt', 'bar.txt'];
describe('when all given glob pattern configs matched', () => {
const globPatternsConfigs = [
{anyGlobToAnyFile: ['foo.txt']},
{anyGlobToAllFiles: ['*.txt']},
{allGlobsToAllFiles: ['**']}
];
it('returns true', () => {
const result = checkAllChangedFiles(
changedFiles,
globPatternsConfigs,
false
);
expect(result).toBe(true);
});
});
describe(`when some given glob pattern config did not match`, () => {
const globPatternsConfigs = [
{anyGlobToAnyFile: ['*.md']},
{anyGlobToAllFiles: ['*.txt']},
{allGlobsToAllFiles: ['**']}
];
it('returns false', () => {
const result = checkAllChangedFiles(
changedFiles,
globPatternsConfigs,
false
);
expect(result).toBe(false);
});
});
});
describe('checkAnyChangedFiles', () => {
const changedFiles = ['foo.txt', 'bar.txt'];
describe('when any given glob pattern config matched', () => {
const globPatternsConfigs = [
{anyGlobToAnyFile: ['*.md']},
{anyGlobToAllFiles: ['*.txt']}
];
it('returns true', () => {
const result = checkAnyChangedFiles(
changedFiles,
globPatternsConfigs,
false
);
expect(result).toBe(true);
});
});
describe('when none of the given glob pattern configs matched', () => {
const globPatternsConfigs = [
{anyGlobToAnyFile: ['*.md']},
{anyGlobToAllFiles: ['!*.txt']}
];
it('returns false', () => {
const result = checkAnyChangedFiles(
changedFiles,
globPatternsConfigs,
false
);
expect(result).toBe(false);
});
});
});
describe('toChangedFilesMatchConfig', () => {
describe(`when there is no 'changed-files' key in the config`, () => {
const config = {'head-branch': 'test'};
it('returns an empty object', () => {
const result = toChangedFilesMatchConfig(config);
expect(result).toEqual<ChangedFilesMatchConfig>({});
});
});
describe(`when there is a 'changed-files' key in the config`, () => {
describe('but the glob pattern config key is not provided', () => {
const config = {'changed-files': ['bar']};
it('throws the error', () => {
expect(() => {
toChangedFilesMatchConfig(config);
}).toThrow(
`The "changed-files" section must have a valid config structure. Please read the action documentation for more information`
);
});
});
describe('but the glob pattern config key is not valid', () => {
const config = {'changed-files': [{NotValidConfigKey: ['bar']}]};
it('throws the error', () => {
expect(() => {
toChangedFilesMatchConfig(config);
}).toThrow(
`Unknown config options were under "changed-files": NotValidConfigKey`
);
});
});
describe('and the glob pattern config key is provided', () => {
describe('and the value is an array of strings', () => {
const config = {
'changed-files': [{'any-glob-to-any-file': ['testing']}]
};
it('sets the value in the config object', () => {
const result = toChangedFilesMatchConfig(config);
expect(result).toEqual<ChangedFilesMatchConfig>({
changedFiles: [{anyGlobToAnyFile: ['testing']}]
});
});
});
describe('and the value is a string', () => {
const config = {'changed-files': [{'any-glob-to-any-file': 'testing'}]};
it(`sets the string as an array in the config object`, () => {
const result = toChangedFilesMatchConfig(config);
expect(result).toEqual<ChangedFilesMatchConfig>({
changedFiles: [{anyGlobToAnyFile: ['testing']}]
});
});
});
});
});
});
describe('checkIfAnyGlobMatchesAnyFile', () => {
const changedFiles = ['foo.txt', 'bar.txt'];
describe('when any given glob pattern matched any file', () => {
const globPatterns = ['*.md', 'foo.txt'];
it('returns true', () => {
const result = checkIfAnyGlobMatchesAnyFile(
changedFiles,
globPatterns,
false
);
expect(result).toBe(true);
});
});
describe('when none of the given glob pattern matched any file', () => {
const globPatterns = ['*.md', '!*.txt'];
it('returns false', () => {
const result = checkIfAnyGlobMatchesAnyFile(
changedFiles,
globPatterns,
false
);
expect(result).toBe(false);
});
});
});
describe('checkIfAllGlobsMatchAnyFile', () => {
const changedFiles = ['foo.txt', 'bar.txt'];
describe('when all given glob patterns matched any file', () => {
const globPatterns = ['**/bar.txt', 'bar.txt'];
it('returns true', () => {
const result = checkIfAllGlobsMatchAnyFile(
changedFiles,
globPatterns,
false
);
expect(result).toBe(true);
});
});
describe('when some of the given glob patterns did not match any file', () => {
const globPatterns = ['*.txt', '*.md'];
it('returns false', () => {
const result = checkIfAllGlobsMatchAnyFile(
changedFiles,
globPatterns,
false
);
expect(result).toBe(false);
});
});
});
describe('checkIfAnyGlobMatchesAllFiles', () => {
const changedFiles = ['foo.txt', 'bar.txt'];
describe('when any given glob pattern matched all files', () => {
const globPatterns = ['*.md', '*.txt'];
it('returns true', () => {
const result = checkIfAnyGlobMatchesAllFiles(
changedFiles,
globPatterns,
false
);
expect(result).toBe(true);
});
});
describe('when none of the given glob patterns matched all files', () => {
const globPatterns = ['*.md', 'bar.txt', 'foo.txt'];
it('returns false', () => {
const result = checkIfAnyGlobMatchesAllFiles(
changedFiles,
globPatterns,
false
);
expect(result).toBe(false);
});
});
});
describe('checkIfAllGlobsMatchAllFiles', () => {
const changedFiles = ['foo.txt', 'bar.txt'];
describe('when all given glob patterns matched all files', () => {
const globPatterns = ['*.txt', '**'];
it('returns true', () => {
const result = checkIfAllGlobsMatchAllFiles(
changedFiles,
globPatterns,
false
);
expect(result).toBe(true);
});
});
describe('when some of the given glob patterns did not match all files', () => {
const globPatterns = ['**', 'foo.txt'];
it('returns false', () => {
const result = checkIfAllGlobsMatchAllFiles(
changedFiles,
globPatterns,
false
);
expect(result).toBe(false);
});
});
});

View File

@@ -0,0 +1,17 @@
label1:
- any:
- changed-files:
- any-glob-to-any-file: ['glob']
- head-branch: ['regexp']
- base-branch: ['regexp']
- all:
- changed-files:
- all-globs-to-all-files: ['glob']
- head-branch: ['regexp']
- base-branch: ['regexp']
label2:
- changed-files:
- any-glob-to-any-file: ['glob']
- head-branch: ['regexp']
- base-branch: ['regexp']

View File

@@ -0,0 +1,8 @@
tests:
- any:
- head-branch: ['^tests/', '^test/']
- changed-files:
- any-glob-to-any-file: ['tests/**/*']
- all:
- changed-files:
- all-globs-to-all-files: ['!tests/requirements.txt']

View File

@@ -0,0 +1,11 @@
test-branch:
- head-branch: '^test/'
feature-branch:
- head-branch: '/feature/'
bug-branch:
- head-branch: '^bug/|fix/'
array-branch:
- head-branch: ['^array/']

View File

@@ -0,0 +1,3 @@
label:
- all:
- unknown: 'this-is-not-supported'

View File

@@ -1,2 +1,3 @@
touched-a-pdf-file:
- any: ['*.pdf']
- changed-files:
- any-glob-to-any-file: ['*.pdf']

View File

@@ -1,8 +1,19 @@
import {checkGlobs} from '../src/labeler';
import * as yaml from 'js-yaml';
import * as core from '@actions/core';
import * as api from '../src/api';
import {labeler} from '../src/labeler';
import * as github from '@actions/github';
import * as fs from 'fs';
import {checkMatchConfigs} from '../src/labeler';
import {
MatchConfig,
toMatchConfig,
getLabelConfigMapFromObject,
BaseMatchConfig
} from '../src/api/get-label-configs';
jest.mock('@actions/core');
jest.mock('../src/api');
beforeAll(() => {
jest.spyOn(core, 'getInput').mockImplementation((name, options) => {
@@ -10,34 +21,215 @@ beforeAll(() => {
});
});
const matchConfig = [{any: ['*.txt']}];
const loadYaml = (filepath: string) => {
const loadedFile = fs.readFileSync(filepath);
const content = Buffer.from(loadedFile).toString();
return yaml.load(content);
};
describe('checkGlobs', () => {
it('returns true when our pattern does match changed files', () => {
const changedFiles = ['foo.txt', 'bar.txt'];
const result = checkGlobs(changedFiles, matchConfig, false);
describe('getLabelConfigMapFromObject', () => {
const yamlObject = loadYaml('__tests__/fixtures/all_options.yml');
const expected = new Map<string, MatchConfig[]>();
expected.set('label1', [
{
any: [
{changedFiles: [{anyGlobToAnyFile: ['glob']}]},
{baseBranch: undefined, headBranch: ['regexp']},
{baseBranch: ['regexp'], headBranch: undefined}
]
},
{
all: [
{changedFiles: [{allGlobsToAllFiles: ['glob']}]},
{baseBranch: undefined, headBranch: ['regexp']},
{baseBranch: ['regexp'], headBranch: undefined}
]
}
]);
expected.set('label2', [
{
any: [
{changedFiles: [{anyGlobToAnyFile: ['glob']}]},
{baseBranch: undefined, headBranch: ['regexp']},
{baseBranch: ['regexp'], headBranch: undefined}
]
}
]);
expect(result).toBeTruthy();
});
it('returns false when our pattern does not match changed files', () => {
const changedFiles = ['foo.docx'];
const result = checkGlobs(changedFiles, matchConfig, false);
expect(result).toBeFalsy();
});
it('returns false for a file starting with dot if `dot` option is false', () => {
const changedFiles = ['.foo.txt'];
const result = checkGlobs(changedFiles, matchConfig, false);
expect(result).toBeFalsy();
});
it('returns true for a file starting with dot if `dot` option is true', () => {
const changedFiles = ['.foo.txt'];
const result = checkGlobs(changedFiles, matchConfig, true);
expect(result).toBeTruthy();
it('returns a MatchConfig', () => {
const result = getLabelConfigMapFromObject(yamlObject);
expect(result).toEqual(expected);
});
});
describe('toMatchConfig', () => {
describe('when all expected config options are present', () => {
const config = {
'changed-files': [{'any-glob-to-any-file': ['testing-files']}],
'head-branch': ['testing-head'],
'base-branch': ['testing-base']
};
const expected: BaseMatchConfig = {
changedFiles: [{anyGlobToAnyFile: ['testing-files']}],
headBranch: ['testing-head'],
baseBranch: ['testing-base']
};
it('returns a MatchConfig object with all options', () => {
const result = toMatchConfig(config);
expect(result).toEqual(expected);
});
describe('and there are also unexpected options present', () => {
config['test-test'] = 'testing';
it('does not include the unexpected items in the returned MatchConfig object', () => {
const result = toMatchConfig(config);
expect(result).toEqual(expected);
});
});
});
});
describe('checkMatchConfigs', () => {
describe('when a single match config is provided', () => {
const matchConfig: MatchConfig[] = [
{any: [{changedFiles: [{anyGlobToAnyFile: ['*.txt']}]}]}
];
it('returns true when our pattern does match changed files', () => {
const changedFiles = ['foo.txt', 'bar.txt'];
const result = checkMatchConfigs(changedFiles, matchConfig, false);
expect(result).toBeTruthy();
});
it('returns false when our pattern does not match changed files', () => {
const changedFiles = ['foo.docx'];
const result = checkMatchConfigs(changedFiles, matchConfig, false);
expect(result).toBeFalsy();
});
it('returns true when either the branch or changed files patter matches', () => {
const matchConfig: MatchConfig[] = [
{
any: [
{changedFiles: [{anyGlobToAnyFile: ['*.txt']}]},
{headBranch: ['some-branch']}
]
}
];
const changedFiles = ['foo.txt', 'bar.txt'];
const result = checkMatchConfigs(changedFiles, matchConfig, false);
expect(result).toBe(true);
});
it('returns false for a file starting with dot if `dot` option is false', () => {
const changedFiles = ['.foo.txt'];
const result = checkMatchConfigs(changedFiles, matchConfig, false);
expect(result).toBeFalsy();
});
it('returns true for a file starting with dot if `dot` option is true', () => {
const changedFiles = ['.foo.txt'];
const result = checkMatchConfigs(changedFiles, matchConfig, true);
expect(result).toBeTruthy();
});
});
describe('when multiple MatchConfigs are supplied', () => {
const matchConfig: MatchConfig[] = [
{any: [{changedFiles: [{anyGlobToAnyFile: ['*.txt']}]}]},
{any: [{headBranch: ['some-branch']}]}
];
const changedFiles = ['foo.txt', 'bar.md'];
it('returns false when only one config matches', () => {
const result = checkMatchConfigs(changedFiles, matchConfig, false);
expect(result).toBe(false);
});
it('returns true when only both config matches', () => {
const matchConfig: MatchConfig[] = [
{any: [{changedFiles: [{anyGlobToAnyFile: ['*.txt']}]}]},
{any: [{headBranch: ['head-branch']}]}
];
const result = checkMatchConfigs(changedFiles, matchConfig, false);
expect(result).toBe(true);
});
});
});
describe('labeler error handling', () => {
const mockClient = {} as any;
const mockPullRequest = {
number: 123,
data: {labels: []},
changedFiles: []
};
beforeEach(() => {
jest.resetAllMocks();
(github.getOctokit as jest.Mock).mockReturnValue(mockClient);
(api.getPullRequests as jest.Mock).mockReturnValue([
{
...mockPullRequest,
data: {labels: [{name: 'old-label'}]}
}
]);
(api.getLabelConfigs as jest.Mock).mockResolvedValue(
new Map([['new-label', ['dummy-config']]])
);
// Force match so "new-label" is always added
jest.spyOn({checkMatchConfigs}, 'checkMatchConfigs').mockReturnValue(true);
});
it('throws a custom error for HttpError 403 with "unauthorized" message', async () => {
(api.setLabels as jest.Mock).mockRejectedValue({
name: 'HttpError',
status: 403,
message: 'Request failed with status code 403: Unauthorized'
});
await expect(labeler()).rejects.toThrow(
/does not have permission to create labels/
);
});
it('rethrows unexpected HttpError', async () => {
const unexpectedError = {
name: 'HttpError',
status: 404,
message: 'Not Found'
};
(api.setLabels as jest.Mock).mockRejectedValue(unexpectedError);
// NOTE: In the current implementation, labeler rethrows the raw error object (not an Error instance).
// `rejects.toThrow` only works with real Error objects, so here we must use `rejects.toEqual`.
// If labeler is updated to always wrap errors in `Error`, this test can be changed to use `rejects.toThrow`.
await expect(labeler()).rejects.toEqual(unexpectedError);
});
it('handles "Resource not accessible by integration" gracefully', async () => {
const error = {
name: 'HttpError',
message: 'Resource not accessible by integration'
};
(api.setLabels as jest.Mock).mockRejectedValue(error);
await labeler();
expect(core.warning).toHaveBeenCalledWith(
expect.stringContaining("requires 'issues: write'"),
expect.any(Object)
);
expect(core.setFailed).toHaveBeenCalledWith(error.message);
});
});

View File

@@ -3,7 +3,6 @@ import * as github from '@actions/github';
import * as core from '@actions/core';
import path from 'path';
import fs from 'fs';
import each from 'jest-each';
jest.mock('@actions/core');
jest.mock('@actions/github');
@@ -35,7 +34,10 @@ class NotFound extends Error {
}
const yamlFixtures = {
'only_pdfs.yml': fs.readFileSync('__tests__/fixtures/only_pdfs.yml')
'branches.yml': fs.readFileSync('__tests__/fixtures/branches.yml'),
'only_pdfs.yml': fs.readFileSync('__tests__/fixtures/only_pdfs.yml'),
'not_supported.yml': fs.readFileSync('__tests__/fixtures/not_supported.yml'),
'any_and_all.yml': fs.readFileSync('__tests__/fixtures/any_and_all.yml')
};
const configureInput = (
@@ -147,6 +149,121 @@ describe('run', () => {
expect(setLabelsMock).toHaveBeenCalledTimes(0);
});
it('does not add a label when the match config options are not supported', async () => {
configureInput({});
usingLabelerConfigYaml('not_supported.yml');
await run();
expect(setLabelsMock).toHaveBeenCalledTimes(0);
});
it('adds labels based on the branch names that match the regexp pattern', async () => {
configureInput({});
github.context.payload.pull_request!.head = {ref: 'test/testing-time'};
usingLabelerConfigYaml('branches.yml');
await run();
expect(setLabelsMock).toHaveBeenCalledTimes(1);
expect(setLabelsMock).toHaveBeenCalledWith({
owner: 'monalisa',
repo: 'helloworld',
issue_number: 123,
labels: ['test-branch']
});
expect(setOutputSpy).toHaveBeenCalledWith('new-labels', 'test-branch');
expect(setOutputSpy).toHaveBeenCalledWith('all-labels', 'test-branch');
});
it('adds multiple labels based on branch names that match different regexp patterns', async () => {
configureInput({});
github.context.payload.pull_request!.head = {
ref: 'test/feature/123'
};
usingLabelerConfigYaml('branches.yml');
await run();
expect(setLabelsMock).toHaveBeenCalledTimes(1);
expect(setLabelsMock).toHaveBeenCalledWith({
owner: 'monalisa',
repo: 'helloworld',
issue_number: 123,
labels: ['test-branch', 'feature-branch']
});
expect(setOutputSpy).toHaveBeenCalledWith(
'new-labels',
'test-branch,feature-branch'
);
expect(setOutputSpy).toHaveBeenCalledWith(
'all-labels',
'test-branch,feature-branch'
);
});
it('can support multiple branches by batching', async () => {
configureInput({});
github.context.payload.pull_request!.head = {ref: 'fix/123'};
usingLabelerConfigYaml('branches.yml');
await run();
expect(setLabelsMock).toHaveBeenCalledTimes(1);
expect(setLabelsMock).toHaveBeenCalledWith({
owner: 'monalisa',
repo: 'helloworld',
issue_number: 123,
labels: ['bug-branch']
});
expect(setOutputSpy).toHaveBeenCalledWith('new-labels', 'bug-branch');
expect(setOutputSpy).toHaveBeenCalledWith('all-labels', 'bug-branch');
});
it('can support multiple branches by providing an array', async () => {
configureInput({});
github.context.payload.pull_request!.head = {ref: 'array/123'};
usingLabelerConfigYaml('branches.yml');
await run();
expect(setLabelsMock).toHaveBeenCalledTimes(1);
expect(setLabelsMock).toHaveBeenCalledWith({
owner: 'monalisa',
repo: 'helloworld',
issue_number: 123,
labels: ['array-branch']
});
expect(setOutputSpy).toHaveBeenCalledWith('new-labels', 'array-branch');
expect(setOutputSpy).toHaveBeenCalledWith('all-labels', 'array-branch');
});
it('adds a label when matching any and all patterns are provided', async () => {
configureInput({});
usingLabelerConfigYaml('any_and_all.yml');
mockGitHubResponseChangedFiles('tests/test.ts');
await run();
expect(setLabelsMock).toHaveBeenCalledTimes(1);
expect(setLabelsMock).toHaveBeenCalledWith({
owner: 'monalisa',
repo: 'helloworld',
issue_number: 123,
labels: ['tests']
});
expect(setOutputSpy).toHaveBeenCalledWith('new-labels', 'tests');
expect(setOutputSpy).toHaveBeenCalledWith('all-labels', 'tests');
});
it('does not add a label when not all any and all patterns are matched', async () => {
configureInput({});
usingLabelerConfigYaml('any_and_all.yml');
mockGitHubResponseChangedFiles('tests/requirements.txt');
await run();
expect(setLabelsMock).toHaveBeenCalledTimes(0);
});
it('(with sync-labels: true) it deletes preexisting PR labels that no longer match the glob pattern', async () => {
configureInput({
'repo-token': 'foo',
@@ -171,6 +288,7 @@ describe('run', () => {
issue_number: 123,
labels: ['manually-added']
});
expect(setOutputSpy).toHaveBeenCalledWith('new-labels', '');
expect(setOutputSpy).toHaveBeenCalledWith('all-labels', 'manually-added');
});
@@ -353,10 +471,10 @@ describe('run', () => {
expect(reposMock).toHaveBeenCalled();
});
each([
test.each([
[new HttpError('Error message')],
[new NotFound('Error message')]
]).test(
])(
'should warn if configuration file could not be fetched through the API, log error and fail the action',
async error => {
const configFilePath = 'non_existed_path/labeler.yml';

View File

@@ -16,7 +16,7 @@ inputs:
required: false
dot:
description: 'Whether or not to auto-include paths starting with dot (e.g. `.github`)'
default: false
default: true
required: false
pr-number:
description: 'The pull request number(s)'
@@ -28,5 +28,5 @@ outputs:
all-labels:
description: 'A comma-separated list of all labels that the PR contains'
runs:
using: 'node16'
using: 'node24'
main: 'dist/index.js'

38276
dist/index.js vendored

File diff suppressed because one or more lines are too long

8673
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,11 @@
{
"name": "labeler",
"version": "4.1.0",
"version": "6.0.0",
"description": "Labels pull requests by files altered",
"main": "lib/main.js",
"engines": {
"node": ">=24"
},
"scripts": {
"build": "tsc && ncc build lib/main.js",
"format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"",
@@ -24,28 +27,30 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
"@octokit/plugin-retry": "^5.0.5",
"jest-each": "^29.6.1",
"@actions/core": "^1.11.1",
"@actions/github": "^6.0.0",
"@octokit/plugin-retry": "^6.0.0",
"js-yaml": "^4.1.0",
"minimatch": "^7.4.3"
"lodash.isequal": "^4.5.0",
"minimatch": "^10.0.1"
},
"devDependencies": {
"@types/jest": "^27.4.1",
"@types/js-yaml": "^4.0.5",
"@types/jest": "^29.5.14",
"@types/js-yaml": "^4.0.9",
"@types/lodash.isequal": "^4.5.8",
"@types/minimatch": "^5.1.2",
"@types/node": "^16.11.7",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"@vercel/ncc": "^0.36.1",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-jest": "^27.2.2",
"@types/node": "^24.1.0",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.18.0",
"@vercel/ncc": "^0.38.3",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-node": "^11.1.0",
"jest": "^27.5.1",
"prettier": "^2.8.8",
"ts-jest": "^27.1.3",
"typescript": "^4.9.5"
"jest": "^29.7.0",
"prettier": "^3.4.2",
"ts-jest": "^29.2.5",
"typescript": "^5.7.3"
}
}

View File

@@ -0,0 +1,24 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import {ClientType} from './types';
export const getChangedFiles = async (
client: ClientType,
prNumber: number
): Promise<string[]> => {
const listFilesOptions = client.rest.pulls.listFiles.endpoint.merge({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
pull_number: prNumber
});
const listFilesResponse = await client.paginate(listFilesOptions);
const changedFiles = listFilesResponse.map((f: any) => f.filename);
core.debug('found changed files:');
for (const file of changedFiles) {
core.debug(' ' + file);
}
return changedFiles;
};

View File

@@ -0,0 +1,38 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import {getChangedFiles} from './get-changed-files';
import {ClientType} from './types';
export async function* getPullRequests(
client: ClientType,
prNumbers: number[]
) {
for (const prNumber of prNumbers) {
core.debug(`looking for pr #${prNumber}`);
let prData: any;
try {
const result = await client.rest.pulls.get({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
pull_number: prNumber
});
prData = result.data;
} catch (error: any) {
core.warning(`Could not find pull request #${prNumber}, skipping`);
continue;
}
core.debug(`fetching changed files for pr #${prNumber}`);
const changedFiles: string[] = await getChangedFiles(client, prNumber);
if (!changedFiles.length) {
core.warning(`Pull request #${prNumber} has no changed files, skipping`);
continue;
}
yield {
data: prData,
number: prNumber,
changedFiles
};
}
}

16
src/api/get-content.ts Normal file
View File

@@ -0,0 +1,16 @@
import * as github from '@actions/github';
import {ClientType} from './types';
export const getContent = async (
client: ClientType,
repoPath: string
): Promise<string> => {
const response: any = await client.rest.repos.getContent({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
path: repoPath,
ref: github.context.sha
});
return Buffer.from(response.data.content, response.data.encoding).toString();
};

View File

@@ -0,0 +1,126 @@
import * as core from '@actions/core';
import * as yaml from 'js-yaml';
import fs from 'fs';
import {ClientType} from './types';
import {getContent} from './get-content';
import {
ChangedFilesMatchConfig,
toChangedFilesMatchConfig
} from '../changedFiles';
import {toBranchMatchConfig, BranchMatchConfig} from '../branch';
export interface MatchConfig {
all?: BaseMatchConfig[];
any?: BaseMatchConfig[];
}
export type BaseMatchConfig = BranchMatchConfig & ChangedFilesMatchConfig;
const ALLOWED_CONFIG_KEYS = ['changed-files', 'head-branch', 'base-branch'];
export const getLabelConfigs = (
client: ClientType,
configurationPath: string
): Promise<Map<string, MatchConfig[]>> =>
Promise.resolve()
.then(() => {
if (!fs.existsSync(configurationPath)) {
core.info(
`The configuration file (path: ${configurationPath}) was not found locally, fetching via the api`
);
return getContent(client, configurationPath);
}
core.info(
`The configuration file (path: ${configurationPath}) was found locally, reading from the file`
);
return fs.readFileSync(configurationPath, {
encoding: 'utf8'
});
})
.catch(error => {
if (error.name == 'HttpError' || error.name == 'NotFound') {
core.warning(
`The config file was not found at ${configurationPath}. Make sure it exists and that this action has the correct access rights.`
);
}
return Promise.reject(error);
})
.then(configuration => {
// loads (hopefully) a `{[label:string]: MatchConfig[]}`, but is `any`:
const configObject: any = yaml.load(configuration);
// transform `any` => `Map<string,MatchConfig[]>` or throw if yaml is malformed:
return getLabelConfigMapFromObject(configObject);
});
export function getLabelConfigMapFromObject(
configObject: any
): Map<string, MatchConfig[]> {
const labelMap: Map<string, MatchConfig[]> = new Map();
for (const label in configObject) {
const configOptions = configObject[label];
if (
!Array.isArray(configOptions) ||
!configOptions.every(opts => typeof opts === 'object')
) {
throw Error(
`found unexpected type for label '${label}' (should be array of config options)`
);
}
const matchConfigs = configOptions.reduce<MatchConfig[]>(
(updatedConfig, configValue) => {
if (!configValue) {
return updatedConfig;
}
Object.entries(configValue).forEach(([key, value]) => {
// If the top level `any` or `all` keys are provided then set them, and convert their values to
// our config objects.
if (key === 'any' || key === 'all') {
if (Array.isArray(value)) {
const newConfigs = value.map(toMatchConfig);
updatedConfig.push({[key]: newConfigs});
}
} else if (ALLOWED_CONFIG_KEYS.includes(key)) {
const newMatchConfig = toMatchConfig({[key]: value});
// Find or set the `any` key so that we can add these properties to that rule,
// Or create a new `any` key and add that to our array of configs.
const indexOfAny = updatedConfig.findIndex(mc => !!mc['any']);
if (indexOfAny >= 0) {
updatedConfig[indexOfAny].any?.push(newMatchConfig);
} else {
updatedConfig.push({any: [newMatchConfig]});
}
} else {
// Log the key that we don't know what to do with.
core.info(`An unknown config option was under ${label}: ${key}`);
}
});
return updatedConfig;
},
[]
);
if (matchConfigs.length) {
labelMap.set(label, matchConfigs);
}
}
return labelMap;
}
export function toMatchConfig(config: any): BaseMatchConfig {
const changedFilesConfig = toChangedFilesMatchConfig(config);
const branchConfig = toBranchMatchConfig(config);
return {
...changedFilesConfig,
...branchConfig
};
}

6
src/api/index.ts Normal file
View File

@@ -0,0 +1,6 @@
export * from './get-changed-files';
export * from './get-changed-pull-requests';
export * from './get-content';
export * from './get-label-configs';
export * from './set-labels';
export * from './types';

15
src/api/set-labels.ts Normal file
View File

@@ -0,0 +1,15 @@
import * as github from '@actions/github';
import {ClientType} from './types';
export const setLabels = async (
client: ClientType,
prNumber: number,
labels: string[]
) => {
await client.rest.issues.setLabels({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
issue_number: prNumber,
labels: labels
});
};

2
src/api/types.ts Normal file
View File

@@ -0,0 +1,2 @@
import * as github from '@actions/github';
export type ClientType = ReturnType<typeof github.getOctokit>;

98
src/branch.ts Normal file
View File

@@ -0,0 +1,98 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
export interface BranchMatchConfig {
headBranch?: string[];
baseBranch?: string[];
}
type BranchBase = 'base' | 'head';
export function toBranchMatchConfig(config: any): BranchMatchConfig {
if (!config['head-branch'] && !config['base-branch']) {
return {};
}
const branchConfig = {
headBranch: config['head-branch'],
baseBranch: config['base-branch']
};
for (const branchName in branchConfig) {
if (typeof branchConfig[branchName] === 'string') {
branchConfig[branchName] = [branchConfig[branchName]];
}
}
return branchConfig;
}
export function getBranchName(branchBase: BranchBase): string | undefined {
const pullRequest = github.context.payload.pull_request;
if (!pullRequest) {
return undefined;
}
if (branchBase === 'base') {
return pullRequest.base?.ref;
} else {
return pullRequest.head?.ref;
}
}
export function checkAnyBranch(
regexps: string[],
branchBase: BranchBase
): boolean {
const branchName = getBranchName(branchBase);
if (!branchName) {
core.debug(` no branch name`);
return false;
}
core.debug(` checking "branch" pattern against ${branchName}`);
const matchers = regexps.map(regexp => new RegExp(regexp));
for (const matcher of matchers) {
if (matchBranchPattern(matcher, branchName)) {
core.debug(` "branch" patterns matched against ${branchName}`);
return true;
}
}
core.debug(` "branch" patterns did not match against ${branchName}`);
return false;
}
export function checkAllBranch(
regexps: string[],
branchBase: BranchBase
): boolean {
const branchName = getBranchName(branchBase);
if (!branchName) {
core.debug(` cannot fetch branch name from the pull request`);
return false;
}
core.debug(` checking "branch" pattern against ${branchName}`);
const matchers = regexps.map(regexp => new RegExp(regexp));
for (const matcher of matchers) {
if (!matchBranchPattern(matcher, branchName)) {
core.debug(` "branch" patterns did not match against ${branchName}`);
return false;
}
}
core.debug(` "branch" patterns matched against ${branchName}`);
return true;
}
function matchBranchPattern(matcher: RegExp, branchName: string): boolean {
core.debug(` - ${matcher}`);
if (matcher.test(branchName)) {
core.debug(` "branch" pattern matched`);
return true;
}
core.debug(` ${matcher} did not match`);
return false;
}

360
src/changedFiles.ts Normal file
View File

@@ -0,0 +1,360 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import {Minimatch} from 'minimatch';
import {printPattern, isObject, kebabToCamel} from './utils';
export interface ChangedFilesMatchConfig {
changedFiles?: ChangedFilesGlobPatternsConfig[];
}
interface ChangedFilesGlobPatternsConfig {
anyGlobToAnyFile?: string[];
anyGlobToAllFiles?: string[];
allGlobsToAnyFile?: string[];
allGlobsToAllFiles?: string[];
}
type ClientType = ReturnType<typeof github.getOctokit>;
const ALLOWED_FILES_CONFIG_KEYS = [
'any-glob-to-any-file',
'any-glob-to-all-files',
'all-globs-to-any-file',
'all-globs-to-all-files'
];
export async function getChangedFiles(
client: ClientType,
prNumber: number
): Promise<string[]> {
const listFilesOptions = client.rest.pulls.listFiles.endpoint.merge({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
pull_number: prNumber
});
const listFilesResponse = await client.paginate(listFilesOptions);
const changedFiles = listFilesResponse.map((f: any) => f.filename);
core.debug('found changed files:');
for (const file of changedFiles) {
core.debug(' ' + file);
}
return changedFiles;
}
export function toChangedFilesMatchConfig(
config: any
): ChangedFilesMatchConfig {
if (!config['changed-files'] || !config['changed-files'].length) {
return {};
}
const changedFilesConfigs = Array.isArray(config['changed-files'])
? config['changed-files']
: [config['changed-files']];
const validChangedFilesConfigs: ChangedFilesGlobPatternsConfig[] = [];
changedFilesConfigs.forEach(changedFilesConfig => {
if (!isObject(changedFilesConfig)) {
throw new Error(
`The "changed-files" section must have a valid config structure. Please read the action documentation for more information`
);
}
const changedFilesConfigKeys = Object.keys(changedFilesConfig);
const invalidKeys = changedFilesConfigKeys.filter(
key => !ALLOWED_FILES_CONFIG_KEYS.includes(key)
);
if (invalidKeys.length) {
throw new Error(
`Unknown config options were under "changed-files": ${invalidKeys.join(
', '
)}`
);
}
changedFilesConfigKeys.forEach(key => {
validChangedFilesConfigs.push({
[kebabToCamel(key)]: Array.isArray(changedFilesConfig[key])
? changedFilesConfig[key]
: [changedFilesConfig[key]]
});
});
});
return {
changedFiles: validChangedFilesConfigs
};
}
export function checkAnyChangedFiles(
changedFiles: string[],
globPatternsConfigs: ChangedFilesGlobPatternsConfig[],
dot: boolean
): boolean {
core.debug(` checking "changed-files" patterns`);
for (const globPatternsConfig of globPatternsConfigs) {
if (globPatternsConfig.anyGlobToAnyFile) {
if (
checkIfAnyGlobMatchesAnyFile(
changedFiles,
globPatternsConfig.anyGlobToAnyFile,
dot
)
) {
core.debug(` "changed-files" matched`);
return true;
}
}
if (globPatternsConfig.anyGlobToAllFiles) {
if (
checkIfAnyGlobMatchesAllFiles(
changedFiles,
globPatternsConfig.anyGlobToAllFiles,
dot
)
) {
core.debug(` "changed-files" matched`);
return true;
}
}
if (globPatternsConfig.allGlobsToAnyFile) {
if (
checkIfAllGlobsMatchAnyFile(
changedFiles,
globPatternsConfig.allGlobsToAnyFile,
dot
)
) {
core.debug(` "changed-files" matched`);
return true;
}
}
if (globPatternsConfig.allGlobsToAllFiles) {
if (
checkIfAllGlobsMatchAllFiles(
changedFiles,
globPatternsConfig.allGlobsToAllFiles,
dot
)
) {
core.debug(` "changed-files" matched`);
return true;
}
}
}
core.debug(` "changed-files" did not match`);
return false;
}
export function checkAllChangedFiles(
changedFiles: string[],
globPatternsConfigs: ChangedFilesGlobPatternsConfig[],
dot: boolean
): boolean {
core.debug(` checking "changed-files" patterns`);
for (const globPatternsConfig of globPatternsConfigs) {
if (globPatternsConfig.anyGlobToAnyFile) {
if (
!checkIfAnyGlobMatchesAnyFile(
changedFiles,
globPatternsConfig.anyGlobToAnyFile,
dot
)
) {
core.debug(` "changed-files" did not match`);
return false;
}
}
if (globPatternsConfig.anyGlobToAllFiles) {
if (
!checkIfAnyGlobMatchesAllFiles(
changedFiles,
globPatternsConfig.anyGlobToAllFiles,
dot
)
) {
core.debug(` "changed-files" did not match`);
return false;
}
}
if (globPatternsConfig.allGlobsToAnyFile) {
if (
!checkIfAllGlobsMatchAnyFile(
changedFiles,
globPatternsConfig.allGlobsToAnyFile,
dot
)
) {
core.debug(` "changed-files" did not match`);
return false;
}
}
if (globPatternsConfig.allGlobsToAllFiles) {
if (
!checkIfAllGlobsMatchAllFiles(
changedFiles,
globPatternsConfig.allGlobsToAllFiles,
dot
)
) {
core.debug(` "changed-files" did not match`);
return false;
}
}
}
core.debug(` "changed-files" patterns matched`);
return true;
}
export function checkIfAnyGlobMatchesAnyFile(
changedFiles: string[],
globs: string[],
dot: boolean
): boolean {
core.debug(` checking "any-glob-to-any-file" config patterns`);
const matchers = globs.map(g => new Minimatch(g, {dot}));
for (const matcher of matchers) {
const matchedFile = changedFiles.find(changedFile => {
core.debug(
` checking "${printPattern(
matcher
)}" pattern against ${changedFile}`
);
return matcher.match(changedFile);
});
if (matchedFile) {
core.debug(
` "${printPattern(matcher)}" pattern matched ${matchedFile}`
);
return true;
}
}
core.debug(` none of the patterns matched any of the files`);
return false;
}
export function checkIfAllGlobsMatchAnyFile(
changedFiles: string[],
globs: string[],
dot: boolean
): boolean {
core.debug(` checking "all-globs-to-any-file" config patterns`);
const matchers = globs.map(g => new Minimatch(g, {dot}));
for (const changedFile of changedFiles) {
const mismatchedGlob = matchers.find(matcher => {
core.debug(
` checking "${printPattern(
matcher
)}" pattern against ${changedFile}`
);
return !matcher.match(changedFile);
});
if (mismatchedGlob) {
core.debug(
` "${printPattern(
mismatchedGlob
)}" pattern did not match ${changedFile}`
);
continue;
}
core.debug(` all patterns matched ${changedFile}`);
return true;
}
core.debug(` none of the files matched all patterns`);
return false;
}
export function checkIfAnyGlobMatchesAllFiles(
changedFiles: string[],
globs: string[],
dot: boolean
): boolean {
core.debug(` checking "any-glob-to-all-files" config patterns`);
const matchers = globs.map(g => new Minimatch(g, {dot}));
for (const matcher of matchers) {
const mismatchedFile = changedFiles.find(changedFile => {
core.debug(
` checking "${printPattern(
matcher
)}" pattern against ${changedFile}`
);
return !matcher.match(changedFile);
});
if (mismatchedFile) {
core.debug(
` "${printPattern(
matcher
)}" pattern did not match ${mismatchedFile}`
);
continue;
}
core.debug(` "${printPattern(matcher)}" pattern matched all files`);
return true;
}
core.debug(` none of the patterns matched all files`);
return false;
}
export function checkIfAllGlobsMatchAllFiles(
changedFiles: string[],
globs: string[],
dot: boolean
): boolean {
core.debug(` checking "all-globs-to-all-files" config patterns`);
const matchers = globs.map(g => new Minimatch(g, {dot}));
for (const changedFile of changedFiles) {
const mismatchedGlob = matchers.find(matcher => {
core.debug(
` checking "${printPattern(
matcher
)}" pattern against ${changedFile}`
);
return !matcher.match(changedFile);
});
if (mismatchedGlob) {
core.debug(
` "${printPattern(
mismatchedGlob
)}" pattern did not match ${changedFile}`
);
return false;
}
}
core.debug(` all patterns matched all files`);
return true;
}

View File

@@ -0,0 +1,10 @@
import * as core from '@actions/core';
import {getPrNumbers} from './get-pr-numbers';
export const getInputs = () => ({
token: core.getInput('repo-token'),
configPath: core.getInput('configuration-path', {required: true}),
syncLabels: core.getBooleanInput('sync-labels'),
dot: core.getBooleanInput('dot'),
prNumbers: getPrNumbers()
});

View File

@@ -0,0 +1,28 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
const getPrNumberFromContext = () =>
github.context.payload.pull_request?.number;
export const getPrNumbers = (): number[] => {
const prInput = core.getMultilineInput('pr-number');
if (!prInput?.length) {
return [getPrNumberFromContext()].filter(Boolean) as number[];
}
const result: number[] = [];
for (const line of prInput) {
const prNumber = parseInt(line, 10);
if (isNaN(prNumber) && prNumber <= 0) {
core.warning(`'${prNumber}' is not a valid pull request number`);
continue;
}
result.push(prNumber);
}
return result;
};

1
src/get-inputs/index.ts Normal file
View File

@@ -0,0 +1 @@
export * from './get-inputs';

View File

@@ -1,312 +1,124 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import * as pluginRetry from '@octokit/plugin-retry';
import * as yaml from 'js-yaml';
import fs from 'fs';
import {Minimatch} from 'minimatch';
import * as api from './api';
import isEqual from 'lodash.isequal';
import {getInputs} from './get-inputs';
interface MatchConfig {
all?: string[];
any?: string[];
}
import {BaseMatchConfig, MatchConfig} from './api/get-label-configs';
import {checkAllChangedFiles, checkAnyChangedFiles} from './changedFiles';
import {checkAnyBranch, checkAllBranch} from './branch';
type StringOrMatchConfig = string | MatchConfig;
type ClientType = ReturnType<typeof github.getOctokit>;
// GitHub Issues cannot have more than 100 labels
const GITHUB_MAX_LABELS = 100;
export async function run() {
try {
const token = core.getInput('repo-token');
const configPath = core.getInput('configuration-path', {required: true});
const syncLabels = !!core.getInput('sync-labels');
const dot = core.getBooleanInput('dot');
export const run = () =>
labeler().catch(error => {
core.error(error);
core.setFailed(error.message);
});
export async function labeler() {
const {token, configPath, syncLabels, dot, prNumbers} = getInputs();
if (!prNumbers.length) {
core.warning('Could not get pull request number(s), exiting');
return;
}
const client: ClientType = github.getOctokit(token, {}, pluginRetry.retry);
const pullRequests = api.getPullRequests(client, prNumbers);
for await (const pullRequest of pullRequests) {
const labelConfigs: Map<string, MatchConfig[]> = await api.getLabelConfigs(
client,
configPath
);
const preexistingLabels = pullRequest.data.labels.map(l => l.name);
const allLabels: Set<string> = new Set<string>(preexistingLabels);
for (const [label, configs] of labelConfigs.entries()) {
core.debug(`processing ${label}`);
if (checkMatchConfigs(pullRequest.changedFiles, configs, dot)) {
allLabels.add(label);
} else if (syncLabels) {
allLabels.delete(label);
}
}
const labelsToAdd = [...allLabels].slice(0, GITHUB_MAX_LABELS);
const excessLabels = [...allLabels].slice(GITHUB_MAX_LABELS);
let newLabels: string[] = [];
try {
if (!isEqual(labelsToAdd, preexistingLabels)) {
await api.setLabels(client, pullRequest.number, labelsToAdd);
newLabels = labelsToAdd.filter(
label => !preexistingLabels.includes(label)
);
}
} catch (error: any) {
if (
error.name === 'HttpError' &&
error.status === 403 &&
error.message.toLowerCase().includes('unauthorized')
) {
throw new Error(
`Failed to set labels for PR #${pullRequest.number}. The workflow does not have permission to create labels. ` +
`Ensure the 'issues: write' permission is granted in the workflow file or manually create the missing labels in the repository before running the action.`
);
} else if (
error.name !== 'HttpError' ||
error.message !== 'Resource not accessible by integration'
) {
throw error;
}
core.warning(
`The action requires 'issues: write' permission to create new labels or 'pull-requests: write' permission to add existing labels to pull requests. ` +
`For more information, refer to the action documentation: https://github.com/actions/labeler#recommended-permissions`,
{
title: `${process.env['GITHUB_ACTION_REPOSITORY']} running under '${github.context.eventName}' is misconfigured`
}
);
core.setFailed(error.message);
const prNumbers = getPrNumbers();
if (!prNumbers.length) {
core.warning('Could not get pull request number(s), exiting');
return;
}
const client: ClientType = github.getOctokit(token, {}, pluginRetry.retry);
core.setOutput('new-labels', newLabels.join(','));
core.setOutput('all-labels', labelsToAdd.join(','));
for (const prNumber of prNumbers) {
core.debug(`looking for pr #${prNumber}`);
let pullRequest: any;
try {
const result = await client.rest.pulls.get({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
pull_number: prNumber
});
pullRequest = result.data;
} catch (error: any) {
core.warning(`Could not find pull request #${prNumber}, skipping`);
continue;
}
core.debug(`fetching changed files for pr #${prNumber}`);
const changedFiles: string[] = await getChangedFiles(client, prNumber);
if (!changedFiles.length) {
core.warning(
`Pull request #${prNumber} has no changed files, skipping`
);
continue;
}
const labelGlobs: Map<string, StringOrMatchConfig[]> =
await getLabelGlobs(client, configPath);
const preexistingLabels = pullRequest.labels.map(l => l.name);
const allLabels: Set<string> = new Set<string>(preexistingLabels);
for (const [label, globs] of labelGlobs.entries()) {
core.debug(`processing ${label}`);
if (checkGlobs(changedFiles, globs, dot)) {
allLabels.add(label);
} else if (syncLabels) {
allLabels.delete(label);
}
}
const labelsToAdd = [...allLabels].slice(0, GITHUB_MAX_LABELS);
const excessLabels = [...allLabels].slice(GITHUB_MAX_LABELS);
try {
let newLabels: string[] = [];
if (!isListEqual(labelsToAdd, preexistingLabels)) {
await setLabels(client, prNumber, labelsToAdd);
newLabels = labelsToAdd.filter(l => !preexistingLabels.includes(l));
}
core.setOutput('new-labels', newLabels.join(','));
core.setOutput('all-labels', labelsToAdd.join(','));
if (excessLabels.length) {
core.warning(
`Maximum of ${GITHUB_MAX_LABELS} labels allowed. Excess labels: ${excessLabels.join(
', '
)}`,
{title: 'Label limit for a PR exceeded'}
);
}
} catch (error: any) {
if (
error.name === 'HttpError' &&
error.message === 'Resource not accessible by integration'
) {
core.warning(
`The action requires write permission to add labels to pull requests. For more information please refer to the action documentation: https://github.com/actions/labeler#permissions`,
{
title: `${process.env['GITHUB_ACTION_REPOSITORY']} running under '${github.context.eventName}' is misconfigured`
}
);
core.setFailed(error.message);
} else {
throw error;
}
}
}
} catch (error: any) {
core.error(error);
core.setFailed(error.message);
}
}
function getPrNumbers(): number[] {
const pullRequestNumbers = core.getMultilineInput('pr-number');
if (pullRequestNumbers && pullRequestNumbers.length) {
const prNumbers: number[] = [];
for (const prNumber of pullRequestNumbers) {
const prNumberInt = parseInt(prNumber, 10);
if (isNaN(prNumberInt) || prNumberInt <= 0) {
core.warning(`'${prNumber}' is not a valid pull request number`);
} else {
prNumbers.push(prNumberInt);
}
}
return prNumbers;
}
const pullRequest = github.context.payload.pull_request;
if (!pullRequest) {
return [];
}
return [pullRequest.number];
}
async function getChangedFiles(
client: ClientType,
prNumber: number
): Promise<string[]> {
const listFilesOptions = client.rest.pulls.listFiles.endpoint.merge({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
pull_number: prNumber
});
const listFilesResponse = await client.paginate(listFilesOptions);
const changedFiles = listFilesResponse.map((f: any) => f.filename);
core.debug('found changed files:');
for (const file of changedFiles) {
core.debug(' ' + file);
}
return changedFiles;
}
async function getLabelGlobs(
client: ClientType,
configurationPath: string
): Promise<Map<string, StringOrMatchConfig[]>> {
let configurationContent: string;
try {
if (!fs.existsSync(configurationPath)) {
core.info(
`The configuration file (path: ${configurationPath}) isn't not found locally, fetching via the api`
);
configurationContent = await fetchContent(client, configurationPath);
} else {
core.info(
`The configuration file (path: ${configurationPath}) is found locally, reading from the file`
);
configurationContent = fs.readFileSync(configurationPath, {
encoding: 'utf8'
});
}
} catch (e: any) {
if (e.name == 'HttpError' || e.name == 'NotFound') {
if (excessLabels.length) {
core.warning(
`The config file was not found at ${configurationPath}. Make sure it exists and that this action has the correct access rights.`
);
}
throw e;
}
// loads (hopefully) a `{[label:string]: string | StringOrMatchConfig[]}`, but is `any`:
const configObject: any = yaml.load(configurationContent);
// transform `any` => `Map<string,StringOrMatchConfig[]>` or throw if yaml is malformed:
return getLabelGlobMapFromObject(configObject);
}
async function fetchContent(
client: ClientType,
repoPath: string
): Promise<string> {
const response: any = await client.rest.repos.getContent({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
path: repoPath,
ref: github.context.sha
});
return Buffer.from(response.data.content, response.data.encoding).toString();
}
function getLabelGlobMapFromObject(
configObject: any
): Map<string, StringOrMatchConfig[]> {
const labelGlobs: Map<string, StringOrMatchConfig[]> = new Map();
for (const label in configObject) {
if (typeof configObject[label] === 'string') {
labelGlobs.set(label, [configObject[label]]);
} else if (configObject[label] instanceof Array) {
labelGlobs.set(label, configObject[label]);
} else {
throw Error(
`found unexpected type for label ${label} (should be string or array of globs)`
`Maximum of ${GITHUB_MAX_LABELS} labels allowed. Excess labels: ${excessLabels.join(
', '
)}`,
{title: 'Label limit for a PR exceeded'}
);
}
}
return labelGlobs;
}
function toMatchConfig(config: StringOrMatchConfig): MatchConfig {
if (typeof config === 'string') {
return {
any: [config]
};
}
return config;
}
function printPattern(matcher: Minimatch): string {
return (matcher.negate ? '!' : '') + matcher.pattern;
}
export function checkGlobs(
export function checkMatchConfigs(
changedFiles: string[],
globs: StringOrMatchConfig[],
matchConfigs: MatchConfig[],
dot: boolean
): boolean {
for (const glob of globs) {
core.debug(` checking pattern ${JSON.stringify(glob)}`);
const matchConfig = toMatchConfig(glob);
if (checkMatch(changedFiles, matchConfig, dot)) {
return true;
}
}
return false;
}
function isMatch(changedFile: string, matchers: Minimatch[]): boolean {
core.debug(` matching patterns against file ${changedFile}`);
for (const matcher of matchers) {
core.debug(` - ${printPattern(matcher)}`);
if (!matcher.match(changedFile)) {
core.debug(` ${printPattern(matcher)} did not match`);
for (const config of matchConfigs) {
core.debug(` checking config ${JSON.stringify(config)}`);
if (!checkMatch(changedFiles, config, dot)) {
return false;
}
}
core.debug(` all patterns matched`);
return true;
}
// equivalent to "Array.some()" but expanded for debugging and clarity
function checkAny(
changedFiles: string[],
globs: string[],
dot: boolean
): boolean {
const matchers = globs.map(g => new Minimatch(g, {dot}));
core.debug(` checking "any" patterns`);
for (const changedFile of changedFiles) {
if (isMatch(changedFile, matchers)) {
core.debug(` "any" patterns matched against ${changedFile}`);
return true;
}
}
core.debug(` "any" patterns did not match any files`);
return false;
}
// equivalent to "Array.every()" but expanded for debugging and clarity
function checkAll(
changedFiles: string[],
globs: string[],
dot: boolean
): boolean {
const matchers = globs.map(g => new Minimatch(g, {dot}));
core.debug(` checking "all" patterns`);
for (const changedFile of changedFiles) {
if (!isMatch(changedFile, matchers)) {
core.debug(` "all" patterns did not match against ${changedFile}`);
return false;
}
}
core.debug(` "all" patterns matched all files`);
return true;
}
@@ -315,14 +127,19 @@ function checkMatch(
matchConfig: MatchConfig,
dot: boolean
): boolean {
if (matchConfig.all !== undefined) {
if (!checkAll(changedFiles, matchConfig.all, dot)) {
if (!Object.keys(matchConfig).length) {
core.debug(` no "any" or "all" patterns to check`);
return false;
}
if (matchConfig.all) {
if (!checkAll(matchConfig.all, changedFiles, dot)) {
return false;
}
}
if (matchConfig.any !== undefined) {
if (!checkAny(changedFiles, matchConfig.any, dot)) {
if (matchConfig.any) {
if (!checkAny(matchConfig.any, changedFiles, dot)) {
return false;
}
}
@@ -330,19 +147,91 @@ function checkMatch(
return true;
}
function isListEqual(listA: string[], listB: string[]): boolean {
return listA.length === listB.length && listA.every(el => listB.includes(el));
// equivalent to "Array.some()" but expanded for debugging and clarity
export function checkAny(
matchConfigs: BaseMatchConfig[],
changedFiles: string[],
dot: boolean
): boolean {
core.debug(` checking "any" patterns`);
if (
!matchConfigs.length ||
!matchConfigs.some(configOption => Object.keys(configOption).length)
) {
core.debug(` no "any" patterns to check`);
return false;
}
for (const matchConfig of matchConfigs) {
if (matchConfig.baseBranch) {
if (checkAnyBranch(matchConfig.baseBranch, 'base')) {
core.debug(` "any" patterns matched`);
return true;
}
}
if (matchConfig.changedFiles) {
if (checkAnyChangedFiles(changedFiles, matchConfig.changedFiles, dot)) {
core.debug(` "any" patterns matched`);
return true;
}
}
if (matchConfig.headBranch) {
if (checkAnyBranch(matchConfig.headBranch, 'head')) {
core.debug(` "any" patterns matched`);
return true;
}
}
}
core.debug(` "any" patterns did not match any configs`);
return false;
}
async function setLabels(
client: ClientType,
prNumber: number,
labels: string[]
) {
await client.rest.issues.setLabels({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
issue_number: prNumber,
labels: labels
});
// equivalent to "Array.every()" but expanded for debugging and clarity
export function checkAll(
matchConfigs: BaseMatchConfig[],
changedFiles: string[],
dot: boolean
): boolean {
core.debug(` checking "all" patterns`);
if (
!matchConfigs.length ||
!matchConfigs.some(configOption => Object.keys(configOption).length)
) {
core.debug(` no "all" patterns to check`);
return false;
}
for (const matchConfig of matchConfigs) {
if (matchConfig.baseBranch) {
if (!checkAllBranch(matchConfig.baseBranch, 'base')) {
core.debug(` "all" patterns did not match`);
return false;
}
}
if (matchConfig.changedFiles) {
if (!changedFiles.length) {
core.debug(` no files to check "changed-files" patterns against`);
return false;
}
if (!checkAllChangedFiles(changedFiles, matchConfig.changedFiles, dot)) {
core.debug(` "all" patterns did not match`);
return false;
}
}
if (matchConfig.headBranch) {
if (!checkAllBranch(matchConfig.headBranch, 'head')) {
core.debug(` "all" patterns did not match`);
return false;
}
}
}
core.debug(` "all" patterns matched all configs`);
return true;
}

13
src/utils.ts Normal file
View File

@@ -0,0 +1,13 @@
import {Minimatch} from 'minimatch';
export const printPattern = (matcher: Minimatch): string => {
return (matcher.negate ? '!' : '') + matcher.pattern;
};
export const kebabToCamel = (str: string): string => {
return str.replace(/-./g, m => m.toUpperCase()[1]);
};
export function isObject(obj: unknown): obj is object {
return obj !== null && typeof obj === 'object' && !Array.isArray(obj);
}