From b1ae417e058dc148c395900fc8989e2dc41fe209 Mon Sep 17 00:00:00 2001 From: Ara Date: Thu, 9 Oct 2025 21:52:27 -0700 Subject: [PATCH] ci: add workflow to auto-label JetBrains plugin issues (#6664) * ci: add workflow to auto-label JetBrains plugin issues Add GitHub Actions workflow that automatically applies the 'JetBrains' label to issues when the JetBrains Plugin type is selected in the issue template. The workflow triggers on issue creation and edits, parsing the issue body to detect the plugin type selection and applying the appropriate label for better issue categorization and triage. * Update .github/workflows/label-jetbrains-issues.yml Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * adding CLI * Update .github/workflows/label-jetbrains-issues.yml Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + .github/workflows/label-jetbrains-issues.yml | 53 ++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/label-jetbrains-issues.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 3f3c556f19..3574691092 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -14,6 +14,7 @@ body: options: - VSCode Extension - JetBrains Plugin + - CLI default: 0 validations: required: true diff --git a/.github/workflows/label-jetbrains-issues.yml b/.github/workflows/label-jetbrains-issues.yml new file mode 100644 index 0000000000..ae1dfb604a --- /dev/null +++ b/.github/workflows/label-jetbrains-issues.yml @@ -0,0 +1,53 @@ +name: Auto-label Issues + +on: + issues: + types: [opened, edited] + +jobs: + label: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - uses: actions/github-script@v7 + with: + script: | + const body = context.payload.issue.body || ''; + const labels = context.payload.issue.labels.map(l => l.name); + + // Check if JetBrains Plugin is selected + if (body.match(/###\s*Plugin Type\s*\n+JetBrains Plugin/i)) { + if (!labels.includes('JetBrains')) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: ['JetBrains'] + }); + } + } + + // Check if VSCode Extension is selected + if (body.match(/###\s*Plugin Type\s*\n+VSCode Extension/i)) { + if (!labels.includes('VS Code')) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: ['VS Code'] + }); + } + } + + // Check if CLI is selected + if (body.match(/###\s*Plugin Type\s*\n+CLI/i)) { + if (!labels.includes('CLI')) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: ['CLI'] + }); + } + }