Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
Signed-off-by: bowenlan-amzn <[email protected]>
  • Loading branch information
bowenlan-amzn committed Nov 14, 2023
1 parent ec56d57 commit d1b4594
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ body:
required: true
- type: dropdown
attributes:
label: Choose the related component
label: Related component
description: Choose one specific OpenSearch component your problem belongs to.
multiple: false
options:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ body:
required: true
- type: dropdown
attributes:
label: Choose the related component
description: Choose one specific OpenSearch component your problem belongs to.
label: Related component
description: Choose one specific OpenSearch component your feature request belongs to.
multiple: false
options:
- Search:Resiliency
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Auto triage based on the component label in issue

on:
issues:
types: [opened]

jobs:
apply-label:
if: github.repository == 'opensearch-project/OpenSearch'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
const { issue, repository } = context.payload;
const { number, body } = issue;
const { owner, name } = repository;
const regex = /###\sRelated\scomponent\n\n(\w*)\n/gm;
let match;
while ( ( match = regex.exec( body ) ) ) {
const [ , component_label ] = match;
await github.rest.issues.addLabels( {
owner: owner.login,
repo: name,
issue_number: number,
labels: [ `${ component_label }` ],
} );
}

0 comments on commit d1b4594

Please sign in to comment.