From 3cd73bccde9b1effc532359e34f2bfb641cb9bd1 Mon Sep 17 00:00:00 2001 From: Vlad Mocanu Date: Thu, 26 Feb 2026 10:30:41 +0200 Subject: [PATCH] revert: remove label check from opened events to prevent duplicates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Forgejo fires both issues/opened AND issues/label_updated when an issue is created with a label. Having the label check on opened caused duplicate Claude runs. Remove it — the label_updated event handles label triggers correctly now that the workflow gate and action normalization are fixed. Co-Authored-By: Claude Opus 4.6 --- src/github/validation/trigger.ts | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) 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