Skip to content

[Feature Request] test1 #2

[Feature Request] test1

[Feature Request] test1 #2

Workflow file for this run

name: Auto triage based on the component label in issue
on:
issues:
types: [opened, reopened]
jobs:
triage:
if: github.repository == 'bowenlan-amzn/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 }` ],
} );
}