1
0
mirror of https://github.com/actions/labeler synced 2026-05-05 03:07:49 +02:00

21 Commits

Author SHA1 Message Date
Luca Boccassi
c5dadc2a45 Add 'changed-files-labels-limit' and 'max-files-changed' configs to allow capping number of labels added (#923)
* README.md: drop trailing whitespace

* Add 'changed-files-labels-limit' config to allow capping number of labels added

When a repository has many components, each with a changed-files label,
a large refactor ends up with the labeler spamming the pull request
with label changes. The end result is not very useful as it's not
very readable, and due to how github automatically hides comments
when label changes overflow the discussion tab, it means useful
information is hidden and one has to manually click "Load more..."
dozens of time every time the page is loaded.

Add a changed-files-labels-limit top level config knob. If more than the
configured limit of labels is set to be added, none are added.
This only affects changed-files labels.

* Add 'max-files-changed' config to allow capping number of files for labelling

When a PR modifies a very large number of files (e.g., tree-wide
refactors, automated code formatting), this new options allows
skipping file-based labeling entirely when the number of files
that are changed hits the configured limit.

Fixes https://github.com/actions/labeler/issues/486
2026-03-26 10:03:12 -05:00
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
MaksimZhukov
9181355e36 Apply suggestions for the beta vesrion and update the documentation 2023-10-31 13:09:20 +01:00
MaksimZhukov
917e5cce72 Merge branch 'main' 2023-10-24 12:11:31 +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
Josh Dales
4554c0d1af Add a bunch more tests 2023-03-25 16:07:56 -04:00
Josh Dales
a9e07ce8ff Add some new tests 2023-03-24 21:23:51 -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
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
65b7640e45 Add unit tests for toMatchConfig 2023-03-18 17:15:18 -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
ed31b27f2e Rename some functions and variables to match what they are doing 2023-02-19 16:46:14 -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
Alexander Kachkaev
866eff55a5 Merge remote-tracking branch 'origin/main' into dot-option 2023-01-16 17:36:24 +00:00
IvanZosimov
0cad484cd0 Add .prettierrc.json to configure Prettier, reformat code 2022-12-19 17:09:22 +01:00
Alexander Kachkaev
409a5a2095 Fix typo in test caption 2022-02-04 13:34:07 +00:00
Alexander Kachkaev
b0d9292064 Implement dot option 2022-02-04 13:26:54 +00:00
Patrick Ellis
a1aa618e7a Fix recursive glob behavior in our npm format script command 2021-06-04 15:55:26 -04:00
Patrick Ellis
9019323db1 🧹 Add basic unit tests (#148)
This is not intended to be a comprehensive test suite; I'm just trying to get us started by adding tests for some of the most important functionality.

This necessitated some minor refactoring. Previously, `main.ts` just directly invoked the main entrypoint function `run()`, which made it impossible to unit test the module without causing the side-effects of `run`. 

As a workaround I created  a new module `labeler.ts`, which just exports the functions we want to test without executing the main entrypoint, and simplified `main.ts` so that it only imports the entrypoint and executes it.

It's basically just a re-org. The diff makes it look way more complicated than it is.
2021-06-03 16:15:47 -04:00