Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(issue-checker-and-label): auto label the issue and pull request with conventional commits standard #2741

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions .github/issue-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
default-mode:
add:
remove: [pull_request_target, issues]
labels:
# skips and removes
- name: skip all
content:
regexes: '[Ss]kip (?:[Aa]ll |)[Ll]abels?'
- name: remove all
content:
regexes: '[Rr]emove (?:[Aa]ll |)[Ll]abels?'
- name: skip ambiguous
content:
regexes: '[Ss]kip (?:[Ll]abels? |)(?:`|)ambiguous(?:`|)'
- name: remove ambiguous
content:
regexes: '[Rr]emove (?:[Ll]abels? |)(?:`|)ambiguous(?:`|)'
# `feature`


- name: enhance
content: enhancement
regexes: '[Ff]eat(?:\([^)]*\))?[\:\.\,]'
skip-if:
- skip all
remove-if:
- remove all
# `Bug fix`
- name: bug-fix
content: Bug fix
regexes: '[Ff]ix(?:\([^)]*\))?[\:\.\,]'
skip-if:
- skip all
remove-if:
- remove all
# `document`
- name: doc
content: documentation
regexes: '[Dd]ocs(?:\([^)]*\))?[\:\.\,]'
skip-if:
- skip all
remove-if:
- remove all
# `test`
- name: test
content: test
regexes: '[Tt]est(?:\([^)]*\))?[\:\.\,]'
skip-if:
- skip all
remove-if:
- remove all
# 工具链等修改
- name: build
content: build
regexes: '[Bb]uild(?:\([^)]*\))?[\:\.\,]'
skip-if:
- skip all
remove-if:
- remove all

# ci持续集成修改
- name: ci
content: ci
regexes: '[Cc]i(?:\([^)]*\))?[\:\.\,]'
skip-if:
- skip all
remove-if:
- remove all


# 代码样式缩进等
- name: style
content: style
regexes: '[Ss]tyle(?:\([^)]*\))?[\:\.\,]'
skip-if:
- skip all
remove-if:
- remove all

# 重构代码结构
- name: refactor
content: refactor
regexes: '[rR]factor(?:\([^)]*\))?[\:\.\,]'
skip-if:
- skip all
remove-if:
- remove all

# 性能优化
- name: perf
content: perf
regexes: '[pP]erf(?:\([^)]*\))?[\:\.\,]'
skip-if:
- skip all
remove-if:
- remove all


# `ambiguous`
- name: pr-ambiguous
# 不符合 commitizen 的 PR
content: ambiguous
regexes: '^(?!(?:build|chore|ci|docs?|feat|fix|perf|refactor|rft|style|test)(?:\([a-zA-Z]*\))?[\:\.\(\,]|[Rr]evert|[Rr]elease)'




mode:
pull_request_target:
skip-if:
- skip all
- skip ambiguous
remove-if:
- remove all
- remove ambiguous
24 changes: 24 additions & 0 deletions .github/workflows/issue-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Issue Checker"
on:
issues:
types: [opened, edited]
pull_request_target:
types: [opened, edited]
issue_comment:
types: [created, edited]

permissions:
contents: read
issues: write
pull-requests: write

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: zzyyyl/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/issue-checker.yml
not-before: 2024-04-20T00:00:00Z
include-title: 1