diff --git a/src/github/validation/trigger.ts b/src/github/validation/trigger.ts index e07482b..809018e 100644 --- a/src/github/validation/trigger.ts +++ b/src/github/validation/trigger.ts @@ -45,21 +45,11 @@ export function checkContainsTrigger(context: ParsedGitHubContext): boolean { } } - // Check for issue body, title, and label trigger on issue creation + // Check for issue body and title trigger on issue creation + // Note: label check is NOT done here — Forgejo fires a separate label_updated + // event even when a label is applied at creation time. Checking labels here + // would cause duplicate runs (both opened + labeled would match). if (isIssuesEvent(context) && context.eventAction === "opened") { - // Check if the issue was created with the trigger label already applied - if (labelTrigger) { - const issueLabels: Array<{ name?: string }> = - (context.payload.issue as any).labels ?? []; - const hasLabel = issueLabels.some((l) => l.name === labelTrigger); - if (hasLabel) { - console.log( - `Issue opened with trigger label '${labelTrigger}' already applied`, - ); - return true; - } - } - const issueBody = context.payload.issue.body || ""; const issueTitle = context.payload.issue.title || ""; // Check for exact match with word boundaries or punctuation