MCPcopy
hub / github.com/openclaw/clawsweeper / tryAddOptionalLabel

Function tryAddOptionalLabel

src/clawsweeper.ts:11190–11213  ·  view source on GitHub ↗
(options: {
  number: number;
  label: string;
  currentLabels: readonly string[];
})

Source from the content-addressed store, hash-verified

11188}
11189
11190function tryAddOptionalLabel(options: {
11191 number: number;
11192 label: string;
11193 currentLabels: readonly string[];
11194}): boolean {
11195 if (options.currentLabels.length >= 100) {
11196 console.warn(
11197 `Skipping optional label sync for ${options.label}: item ${options.number} already has 100 labels`,
11198 );
11199 return false;
11200 }
11201 try {
11202 ghWithRetry(["issue", "edit", String(options.number), "--add-label", options.label]);
11203 return true;
11204 } catch (error) {
11205 if (!missingLabelError(error, options.label) && !labelCapacityError(error)) throw error;
11206 console.warn(
11207 `Skipping optional label sync for ${options.label}: ${
11208 error instanceof Error ? error.message : String(error)
11209 }`,
11210 );
11211 return false;
11212 }
11213}
11214
11215export function isMissingGitHubLabelErrorForTest(message: string, label: string): boolean {
11216 return missingLabelError(new Error(message), label);

Callers 10

syncPriorityLabelFunction · 0.85
syncImpactLabelsFunction · 0.85
syncMergeRiskLabelsFunction · 0.85
syncIssueAdvisoryLabelsFunction · 0.85
syncFeatureShowcaseLabelFunction · 0.85
syncPrRatingLabelFunction · 0.85
syncPrStatusLabelFunction · 0.85

Calls 3

ghWithRetryFunction · 0.85
missingLabelErrorFunction · 0.85
labelCapacityErrorFunction · 0.85

Tested by

no test coverage detected