ci/github-script/bot.js: make llm-assisted label sticky

By popular demand, this patch lets folks manually label PRs with the
label and make it stick, even if auto-labeler wouldn't label it itself
(presumably because the author didn't mark their commits according to
automation policy).

Assisted-by: Codex gpt-5.6-sol medium
This commit is contained in:
Ihar Hrachyshka
2026-09-03 23:26:06 -04:00
parent e697c5f2e0
commit 9686621d1b

View File

@@ -397,11 +397,11 @@ export default async ({ github, context, core, dry }) => {
per_page: 100,
})
// label llm-assisted PRs accordingly
// label llm-assisted PRs accordingly, retaining it if manually set
const assistedByPattern = /Assisted-by: (?!nix-init)/i
evalLabels['llm-assisted'] = prCommits.some((c) =>
assistedByPattern.test(c.commit.message),
)
if (prCommits.some((c) => assistedByPattern.test(c.commit.message))) {
evalLabels['llm-assisted'] = true
}
const commitSubjects = prCommits.map(
(c) => c.commit.message.split('\n')[0],