Redoes the labeler action js backend (#92504)

## About The Pull Request

Redoes the labeler script to work for private or restricted repositories
(both of which need an auth token for using the REST api).

Previous version used `fetch()`, and checked the line diffs which was
inefficient and unnecessary. You only really need to be checking the
filenames when it comes to the diffs.

Now it uses
[octokit.rest.pulls.listFiles](https://octokit.github.io/rest.js/v20/#pulls-list-files)
and pagination. This version is faster and can support a larger amount
of diffs, up to 3000 files changed, and plays nicely with auth tokens
for private or restricted repos. Hooray! Tested the various functions of
it & things should work same as before.

<img width="591" height="171" alt="image"
src="https://github.com/user-attachments/assets/15ff75e2-0335-4b18-b6d7-3aefb312d173"
/>

Also adds support for matching file extensions, so it can find .dmm and
.dmis that might be in directories that do not start with `_maps/` or
`icons/`.

Thanks to @Kocma-san for doing a large part of this and helping figure
out what the issue was.

## Changelog

Not player-facing
This commit is contained in:
Bloop
2025-08-12 18:37:20 -04:00
committed by GitHub
parent 12d5664395
commit 52107b29a0
2 changed files with 159 additions and 96 deletions
+11 -8
View File
@@ -7,31 +7,34 @@
// the label will not be removed
export const file_labels = {
GitHub: {
filepaths: [".github"],
filepaths: [".github/"],
},
SQL: {
filepaths: ["SQL"],
filepaths: ["SQL/"],
},
"Map Edit": {
filepaths: ["_maps"],
filepaths: ["_maps/"],
file_extensions: [".dmm"],
},
Tools: {
filepaths: ["tools"],
filepaths: ["tools/"],
},
"Config Update": {
filepaths: ["config", "code/controllers/configuration/entries"],
filepaths: ["config/", "code/controllers/configuration/entries/"],
add_only: true,
},
Sprites: {
filepaths: ["icons"],
filepaths: ["icons/"],
file_extensions: [".dmi"],
add_only: true,
},
Sound: {
filepaths: ["sound"],
filepaths: ["sound/"],
file_extensions: [".ogg"],
add_only: true,
},
UI: {
filepaths: ["tgui"],
filepaths: ["tgui/"],
add_only: true,
},
};