summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/auto-label-tui.yml
blob: 8f2d80b59eebe3440399288c348b2b280c2335d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Auto-label TUI Issues

on:
  issues:
    types: [opened]

jobs:
  auto-label:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      issues: write
    steps:
      - name: Auto-label and assign issues
        uses: actions/github-script@v7
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          script: |
            const issue = context.payload.issue;
            const title = issue.title;
            const description = issue.body || '';

            // Check for "opencode web" keyword
            const webPattern = /(opencode web)/i;
            const isWebRelated = webPattern.test(title) || webPattern.test(description);

            // Check for version patterns like v1.0.x or 1.0.x
            const versionPattern = /[v]?1\.0\./i;
            const isVersionRelated = versionPattern.test(title) || versionPattern.test(description);

            if (isWebRelated) {
              // Add web label
              await github.rest.issues.addLabels({
                owner: context.repo.owner,
                repo: context.repo.repo,
                issue_number: issue.number,
                labels: ['web']
              });
              
              // Assign to adamdotdevin
              await github.rest.issues.addAssignees({
                owner: context.repo.owner,
                repo: context.repo.repo,
                issue_number: issue.number,
                assignees: ['adamdotdevin']
              });
            } else if (isVersionRelated) {
              // Only add opentui if NOT web-related
              await github.rest.issues.addLabels({
                owner: context.repo.owner,
                repo: context.repo.repo,
                issue_number: issue.number,
                labels: ['opentui']
              });
            }