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'] + }); + } + }