From c715a5cf16b41fa08c9d1795d95d5e0f9785cc9a Mon Sep 17 00:00:00 2001 From: Mystic <215104920@qq.com> Date: Mon, 26 Aug 2024 17:49:33 +0800 Subject: [PATCH] feat: add a more comprehensive labeler example for self-use and demonstration --- .github/labeler.yml | 68 +++++++++++++++++++++++++++--- .github/workflows/apply_labels.yml | 3 +- 2 files changed, 63 insertions(+), 8 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index d385683..f4ed978 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,9 +1,63 @@ version: 1 + labels: - - label: "TestLabel" - title: ".*" - - label: "TestFileMatch" - files: - - "cmd/.*.go" - - "pkg/.*.go" - + # Type: Build-related changes + - label: "@type/build" + title: '^build(?:\(.+\))?\!?:' + + # Type: CI-related changes + - label: "@type/ci" + title: '^ci(?:\(.+\))?\!?:' + files: + - '\.github/.+' + + # Type: Documentation changes + - label: "@type/docs" + title: '^docs(?:\(.+\))?\!?:' + files: + - "docs/.+" + - "**/*.md" + + # Type: New feature + - label: "@type/feature" + title: '^feat(?:\(.+\))?\!?:' + + # Type: Bug fix + - label: "@type/fix" + title: '^fix(?:\(.+\))?\!?:' + + # Type: Improvements such as style changes, refactoring, or performance improvements + - label: "@type/improve" + title: '^(style|refactor|perf)(?:\(.+\))?\!?:' + + # Type: Dependency changes + - label: "@type/dependency" + title: '^(chore|build)(?:\(deps\))?\!?:' + + # Type: Test-related changes + - label: "@type/test" + title: '^test(?:\(.+\))?\!?:' + files: + - "tests/.+" + - "spec/.+" + + # Type: Security-related changes + - label: "@type/security" + title: '^security(?:\(.+\))?\!?:' + files: + - "**/security/.+" + + # Issue Type Only: Feature Request + - label: "Feature Request" + type: issue + title: "^Feature Request:" + + # Issue Type Only: Documentation + - label: "Documentation" + type: issue + title: "^.*(\b[Dd]ocumentation|doc(s)?\b).*" + + # Issue Type Only: Bug Report + - label: "Bug Report" + type: issue + title: "^.*(\b[Bb]ug|b(u)?g(s)?\b).*" diff --git a/.github/workflows/apply_labels.yml b/.github/workflows/apply_labels.yml index bd09a7a..9ac9858 100644 --- a/.github/workflows/apply_labels.yml +++ b/.github/workflows/apply_labels.yml @@ -1,7 +1,8 @@ name: Label PRs with published action as canary on: - pull_request: + - pull_request + - issues jobs: apply_labels: