From 3ef6d41a88c793a236f2e660a75f24eae00c9a20 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Tue, 8 Oct 2024 15:55:43 +0100 Subject: [PATCH] ci: automatic issue closer (#4213) --- .github/ISSUE_TEMPLATE/01_formatter_bug.yml | 2 +- .github/ISSUE_TEMPLATE/02_lint_bug.yml | 2 +- .github/ISSUE_TEMPLATE/03_bug.yml | 2 +- .github/workflows/close-issue.yml | 18 +++++++++++ .github/workflows/needs-repro.yml | 35 +++++++++++++++++++++ 5 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/close-issue.yml create mode 100644 .github/workflows/needs-repro.yml diff --git a/.github/ISSUE_TEMPLATE/01_formatter_bug.yml b/.github/ISSUE_TEMPLATE/01_formatter_bug.yml index e24b2e5ea7d7..38d176a6dc41 100644 --- a/.github/ISSUE_TEMPLATE/01_formatter_bug.yml +++ b/.github/ISSUE_TEMPLATE/01_formatter_bug.yml @@ -1,7 +1,7 @@ name: 📝 Formatter bug report description: Report a bug or regression of the formatter title: "📝 " -labels: [ "S-To triage" ] +labels: [ "S-Needs triage" ] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/02_lint_bug.yml b/.github/ISSUE_TEMPLATE/02_lint_bug.yml index ded21f6e0ab0..0944224f7fb2 100644 --- a/.github/ISSUE_TEMPLATE/02_lint_bug.yml +++ b/.github/ISSUE_TEMPLATE/02_lint_bug.yml @@ -1,7 +1,7 @@ name: 💅 Linter bug report description: Report a bug or regression of the linter title: "💅 <TITLE>" -labels: [ "S-To triage" ] +labels: [ "S-Needs triage" ] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/03_bug.yml b/.github/ISSUE_TEMPLATE/03_bug.yml index 2c6fc38bbbc9..66e3aa9f14fe 100644 --- a/.github/ISSUE_TEMPLATE/03_bug.yml +++ b/.github/ISSUE_TEMPLATE/03_bug.yml @@ -1,7 +1,7 @@ name: 🐛 Bug Report description: Report a possible bug or regression title: "🐛 <TITLE>" -labels: [ "S-To triage" ] +labels: [ "S-Needs triage" ] body: - type: markdown attributes: diff --git a/.github/workflows/close-issue.yml b/.github/workflows/close-issue.yml new file mode 100644 index 000000000000..6c52b7bc58d6 --- /dev/null +++ b/.github/workflows/close-issue.yml @@ -0,0 +1,18 @@ +name: Close issues + +on: + schedule: + - cron: "0 0 * * *" + +jobs: + close-issues: + if: github.repository == 'biomejs/biome' + runs-on: ubuntu-latest + steps: + - name: Close issue without reproduction + uses: actions-cool/issues-helper@v3 + with: + actions: "close-issues" + token: ${{ secrets.GITHUB_TOKEN }} + labels: "S-Needs repro" + inactive-day: 3 diff --git a/.github/workflows/needs-repro.yml b/.github/workflows/needs-repro.yml new file mode 100644 index 000000000000..852feb218388 --- /dev/null +++ b/.github/workflows/needs-repro.yml @@ -0,0 +1,35 @@ +name: Needs reproduction + +on: + issues: + types: [ labeled ] + +jobs: + reply-labeled: + if: github.repository == 'biomejs/biome' + runs-on: ubuntu-latest + steps: + - name: Remove triaging label + if: contains(github.event.issue.labels.*.name, 'S-Bug-confirmed') && contains(github.event.issue.labels.*.name, 'S-Needs triage') + uses: actions-cool/issues-helper@v3 + with: + actions: "remove-labels" + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + labels: "S-Needs triage" + + - name: Needs reproduction + if: github.event.label.name == 'S-Needs repro' + uses: actions-cool/issues-helper@v3 + with: + actions: "create-comment, remove-labels" + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hello @${{ github.event.issue.user.login }}, please provide a minimal reproduction. You can use one of the following options: + + - Provide a link to [our playground](https://biomejs.dev/playground), if it's applicable. + - Provide a link to GitHub repository. To easily create a reproduction, you can use our interactive CLI via `npm create @biomejs/biome-reproduction` + + Issues marked with `S-Needs repro` will be **closed** if they have **no activity within 3 days**. + labels: "S-Needs triage"