Skip to content

Commit

Permalink
chore: add auto labeler workflow (#758)
Browse files Browse the repository at this point in the history
* chore: add auto labeler workflow
添加workflow:提交PR或者修改标题后自动添加/更新 label
自动添加的label包括:
enhancement:标题以feat: 开头
document: 标题以docs: 开头
bug: 标题以fix:开头
refactor-main: 目标分支为refactor/develop
ospp-2024: 目标分支为 ospp-2024/*
  • Loading branch information
hexqi committed Aug 28, 2024
1 parent a7ba103 commit 0d52283
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/auto-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: v1

labels:
- label: 'enhancement'
sync: true
matcher:
title: '^feat:.*'
- label: 'document'
sync: true
matcher:
title: '^docs:.*'
- label: 'bug'
sync: true
matcher:
title: '^fix:.*'
- label: 'ospp-2024'
sync: true
matcher:
baseBranch: '^ospp-2024/.*'
- label: 'refactor-main'
sync: true
matcher:
baseBranch: 'refactor/develop'
19 changes: 19 additions & 0 deletions .github/workflows/auto-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Pull Request Auto Labeler

on:
pull_request_target:
types: [opened, edited]

permissions:
# Setting up permissions in the workflow to limit the scope of what it can do. Optional!
contents: read # the config file
pull-requests: write # for labeling pull requests (on: pull_request_target or on: pull_request)

jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: fuxingloh/multi-labeler@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }} # optional, default to '${{ github.token }}'
config-path: .github/auto-labeler.yml # optional, default to '.github/labeler.yml'

0 comments on commit 0d52283

Please sign in to comment.