From 6874fb84dc8cff998354cda6e8c8669b9e313396 Mon Sep 17 00:00:00 2001 From: Sunny Kolattukudy Date: Wed, 29 Jul 2026 12:09:11 -0400 Subject: [PATCH] fix: restore closed-issue email notifications Closes #279 Generated-with: OpenAI Codex (GPT-5) --- .github/workflows/claude-triage.yml | 9 ++++++--- functions/feedback/IssueWebhookFunction.cs | 12 ++---------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/claude-triage.yml b/.github/workflows/claude-triage.yml index 96489b6..49ce588 100644 --- a/.github/workflows/claude-triage.yml +++ b/.github/workflows/claude-triage.yml @@ -143,7 +143,10 @@ jobs: 5. Add the `triaged` label using `gh label create triaged --color 0e8a16 --force` then `gh issue edit ${{ github.event.issue.number }} --add-label triaged`. - Remove the triggering label using `gh issue edit ${{ github.event.issue.number }} --remove-label "${{ github.event.label.name }}"`. + If the triggering label is `claude-triage`, remove it using + `gh issue edit ${{ github.event.issue.number }} --remove-label "claude-triage"`. + Do not remove `from-website`; it is a persistent provenance label used by + downstream notification and reporting workflows. 6. Write a concise markdown summary of your triage decision to /tmp/triage-summary.md. Include: verdict (feasible/not feasible), reasoning, and action taken. @@ -208,7 +211,7 @@ jobs: fi - name: Remove triggering label - if: always() + if: always() && github.event.label.name == 'claude-triage' env: GH_TOKEN: ${{ github.token }} - run: gh issue edit ${{ github.event.issue.number }} --remove-label "${{ github.event.label.name }}" --repo "${{ github.repository }}" || true + run: gh issue edit ${{ github.event.issue.number }} --remove-label "claude-triage" --repo "${{ github.repository }}" || true diff --git a/functions/feedback/IssueWebhookFunction.cs b/functions/feedback/IssueWebhookFunction.cs index e65afd0..1859f60 100644 --- a/functions/feedback/IssueWebhookFunction.cs +++ b/functions/feedback/IssueWebhookFunction.cs @@ -67,22 +67,14 @@ public async Task Run( if (payload?.Issue is null) return req.CreateResponse(HttpStatusCode.OK); - // ── Filter: only closed issues with the from-website label ──────────── - var label = Environment.GetEnvironmentVariable("GITHUB_ISSUE_LABEL") ?? "from-website"; - if (payload.Action != "closed") { logger.LogInformation("Ignoring action '{Action}' for issue #{Number}", payload.Action, payload.Issue.Number); return req.CreateResponse(HttpStatusCode.OK); } - if (!payload.Issue.Labels.Any(l => l.Name == label)) - { - logger.LogInformation("Issue #{Number} missing label '{Label}' — skipping", payload.Issue.Number, label); - return req.CreateResponse(HttpStatusCode.OK); - } - - // ── Look up submitter email ─────────────────────────────────────────── + // The persisted mapping is authoritative: it is created only for issues + // submitted through the website and is not affected by mutable labels. var mapping = await issueEmailStore.GetAsync(payload.Issue.Number); if (mapping is null) {