ci: automated issue labeler (#8873)

* ci: automated issue labeler

* ci: remove comment

* Apply suggestions from code review

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>

* ci: update labeler on new package

* chore: add core

* ci: add feature req too

* fix: update date

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
Parbez 2023-01-13 15:58:14 +05:30 committed by GitHub
parent 1831acaffb
commit 8c265b628d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 0 deletions

20
.github/issue-labeler.yml vendored Normal file
View file

@ -0,0 +1,20 @@
packages:brokers:
- '### Which package is this (bug report|feature request) for\?\n\nbrokers'
packages:builders:
- '### Which package is this (bug report|feature request) for\?\n\nbuilders'
packages:collection:
- '### Which package is this (bug report|feature request) for\?\n\ncollection'
packages:core:
- '### Which package is this (bug report|feature request) for\?\n\ncore'
packages:discord.js:
- '### Which package is this (bug report|feature request) for\?\n\ndiscord.js'
packages:rest:
- '### Which package is this (bug report|feature request) for\?\n\nrest'
packages:proxy:
- '### Which package is this (bug report|feature request) for\?\n\nproxy'
packages:proxy-container:
- '### Which package is this (bug report|feature request) for\?\n\nproxy-container'
packages:voice:
- '### Which package is this (bug report|feature request) for\?\n\nvoice'
packages:ws:
- '### Which package is this (bug report|feature request) for\?\n\nws'

15
.github/workflows/issue-triage.yml vendored Normal file
View file

@ -0,0 +1,15 @@
name: 'Issue Labeler'
on:
issues:
types: [opened, edited]
jobs:
issue-triage:
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v2.5
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
configuration-path: .github/issue-labeler.yml
not-before: 2023-01-13T10:25:03.847Z
enable-versioned-regex: 0

View file

@ -72,6 +72,13 @@ export async function createPackage(packageName: string, packageDescription?: st
await writeFile('labeler.yml', stringifyYAML(sortedLabelerYAML));
const issueLabelerYAML = parseYAML(await readFile('issue-labeler.yml', 'utf8')) as Record<string, string[]>;
issueLabelerYAML[`packages:${packageName}`] = [
`### Which package is this (bug report|feature request) for\\?\\n\\n${packageName}`,
];
await writeFile('issue-labeler.yml', stringifyYAML(issueLabelerYAML));
// Move back to root
chdir('..');