From dd5cf4211255ad4963b55b9fa1f6300c92c12b1e Mon Sep 17 00:00:00 2001 From: Dina Berry Date: Wed, 8 Apr 2026 08:55:51 -0700 Subject: [PATCH] feat(ci): automated bug retro checklist on issue close --- .github/workflows/squad-bug-retro.yml | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/squad-bug-retro.yml diff --git a/.github/workflows/squad-bug-retro.yml b/.github/workflows/squad-bug-retro.yml new file mode 100644 index 000000000..518e692c8 --- /dev/null +++ b/.github/workflows/squad-bug-retro.yml @@ -0,0 +1,44 @@ +name: Squad Bug Retro + +# Posts a retro checklist comment when bug-labeled issues are closed. +# Helps the team systematically learn from bugs by prompting structured reflection. + +on: + issues: + types: [closed] + +permissions: + issues: write + +concurrency: + group: ${{ github.workflow }}-${{ github.event.issue.number }} + cancel-in-progress: true + +jobs: + post-retro-checklist: + # Only run for issues that carry the "bug" label + if: contains(github.event.issue.labels.*.name, 'bug') + runs-on: ubuntu-latest + steps: + - name: Post bug retro checklist + uses: actions/github-script@v7 + with: + script: | + const body = [ + '## 🔄 Bug Retro Checklist', + '', + '- [ ] **Why did this escape CI?** (missing test? untested code path? mock hid it?)', + '- [ ] **Test added that would have caught it?** (link PR)', + '- [ ] **Is this a class of bug?** (could the same pattern exist elsewhere?)', + '- [ ] **CI/review change needed?** (new lint rule? workflow gate? PR template checkbox?)', + '- [ ] **Retro complete** — check when all above are addressed or skipped', + '', + '_Auto-generated for closed bugs. Skip if trivial (cosmetic/typo). Uncheck "Retro complete" to reopen the retro._', + ].join('\n'); + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body, + });