|
6 | 6 |
|
7 | 7 | jobs: |
8 | 8 | apply-label: |
9 | | - if: github.repository == 'opensearch-project/OpenSearch' |
| 9 | + if: github.repository == 'andrross/OpenSearch' |
10 | 10 | runs-on: ubuntu-latest |
11 | 11 | steps: |
12 | 12 | - uses: actions/github-script@v8 |
13 | 13 | with: |
14 | 14 | script: | |
15 | 15 | const { issue, repository } = context.payload; |
16 | | - const { number, body } = issue; |
| 16 | + const { number, body, user } = issue; |
17 | 17 | const { owner, name } = repository; |
18 | 18 | const regex = /###\sRelated\scomponent\n\n(\w.*)\n/gm; |
19 | 19 | let match; |
| 20 | +
|
20 | 21 | while ( ( match = regex.exec( body ) ) ) { |
21 | 22 | const [ , component_label ] = match; |
22 | | - await github.rest.issues.addLabels( { |
| 23 | +
|
| 24 | + let label |
| 25 | + // Check if the component label is "_No response_" |
| 26 | + if (component_label.trim() === "_No response_") { |
| 27 | + // Add a comment tagging the user |
| 28 | + await github.rest.issues.createComment({ |
| 29 | + owner: owner.login, |
| 30 | + repo: name, |
| 31 | + issue_number: number, |
| 32 | + body: `@${user.login} Please reply to this comment with the relevant component to ensure it gets properly triaged:\n\n- Build\n- Clients\n- Cluster Manager\n- Extensions\n- Indexing:Performance\n- Indexing:Replication\n- Indexing\n- Libraries\n- Other\n- Plugins\n- Search:Aggregations\n- Search:Performance\n- Search:Query Capabilities\n- Search:Query Insights\n- Search:Relevance\n- Search:Remote Search\n- Search:Resiliency\n- Search:Searchable Snapshots\n- Search\n- Storage:Durability\n- Storage:Performance\n- Storage:Remote\n- Storage:Snapshots\n- Storage\n\nReply with the component name, and we'll label this issue appropriately.` |
| 33 | + }); |
| 34 | + label = 'missing-component' |
| 35 | + } else { |
| 36 | + label = component_label |
| 37 | + } |
| 38 | + await github.rest.issues.addLabels({ |
23 | 39 | owner: owner.login, |
24 | 40 | repo: name, |
25 | 41 | issue_number: number, |
26 | | - labels: [ `${ component_label }` ], |
27 | | - } ); |
| 42 | + labels: [label] |
| 43 | + }); |
28 | 44 | } |
29 | | - github.rest.issues.addLabels({ |
| 45 | +
|
| 46 | + // Always add the untriaged label |
| 47 | + await github.rest.issues.addLabels({ |
30 | 48 | issue_number: context.issue.number, |
31 | 49 | owner: context.repo.owner, |
32 | 50 | repo: context.repo.repo, |
33 | 51 | labels: ['untriaged'] |
34 | | - }) |
| 52 | + }); |
0 commit comments