forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: bowenlan-amzn <[email protected]>
- Loading branch information
1 parent
ec56d57
commit 8ea2a6b
Showing
3 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Auto triage based on the component label in issue | ||
on: | ||
issues: | ||
types: [opened, reopened, transferred] | ||
|
||
jobs: | ||
triage: | ||
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 }` ], | ||
} ); | ||
} |