From fa41a030b8a5c7ae5a1b37ddf19c682acfbe2470 Mon Sep 17 00:00:00 2001 From: Lena <241371603+zelenenka@users.noreply.github.com> Date: Wed, 7 Jan 2026 13:40:14 +0100 Subject: [PATCH] Add GH workflow to surface comments on closed bugs (#46249) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sometimes bugs come back or are not fixed all the way. We want to preserve the context of the issue we've closed prematurely so instead of always making people open a new github issue in this case we want to be able to notice if someone* comments on a closed bug and decide what to do about it. Before: Bug is closed → A user can again/still reproduce it on a new version and leaves a comment → Maybe someone sees the notification about it, maybe not; maybe they see it but forget to act on it right away and it's lost. After: Bug is closed → A user can again/still reproduce it on a new version and leaves a comment → The issue is added to a project board where it's visible until someone makes a call about it (maybe the comment was “oh my glob i'm so happy this was fixed” and no action is needed, or maybe the issue must be reopened as a regression). *Someone in this case means (1) not a bot, (2) not a member of staff. Release Notes: - N/A --- .../add_commented_closed_issue_to_project.yml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/add_commented_closed_issue_to_project.yml diff --git a/.github/workflows/add_commented_closed_issue_to_project.yml b/.github/workflows/add_commented_closed_issue_to_project.yml new file mode 100644 index 0000000000..45b3790d36 --- /dev/null +++ b/.github/workflows/add_commented_closed_issue_to_project.yml @@ -0,0 +1,49 @@ +name: "Surface closed issues someone's commented on" + +on: + issue_comment: + types: + - created + +jobs: + add-to-project: + if: > + github.repository == 'zed-industries/zed' && + github.event.issue.state == 'closed' && + github.event.issue.type.name == 'Bug' && + github.event.comment.user.type != 'Bot' + runs-on: ubuntu-latest + steps: + - id: get-app-token + uses: actions/create-github-app-token@df432ccc7b4c53164ccb55b2c30ff6705e2ffc81 # v1.11.7 + with: + app-id: ${{ secrets.ZED_COMMUNITY_BOT_APP_ID }} + private-key: ${{ secrets.ZED_COMMUNITY_BOT_PRIVATE_KEY }} + owner: zed-industries + + - id: check-staff + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + github-token: ${{ steps.get-app-token.outputs.token }} + script: | + try { + const response = await github.rest.teams.getMembershipForUserInOrg({ + org: 'zed-industries', + team_slug: 'staff', + username: context.payload.comment.user.login + }); + return response.data.state === 'active'; + } catch (error) { + // 404 means user is not a member + if (error.status === 404) { + return false; + } + throw error; + } + + # Add to the support team's board for triage + - if: steps.check-staff.outputs.result == 'false' + uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2 + with: + project-url: https://github.com/orgs/zed-industries/projects/71 + github-token: ${{ steps.get-app-token.outputs.token }}