Merge pull request #110

* ci(*): optimize release note generation logic
This commit is contained in:
住京华
2025-01-19 01:02:07 +08:00
committed by GitHub
parent d6012c6499
commit ca40667068
2 changed files with 78 additions and 9 deletions

View File

@@ -11,22 +11,37 @@ categories:
- title: 🛠️ Chores
labels:
- chore
- title: 🏗️ Build System
- title: 📚 Documentation Updates
labels:
- build
- title: ⚡ Performance Improvements
labels:
- perf
- title: 🔨 Refactors
labels:
- refactor
- docs
- title: 🎨 Code Style Updates
labels:
- style
- title: 🔨 Refactors
labels:
- refactor
- title: ⚡ Performance Improvements
labels:
- perf
- title: ✅ Tests
labels:
- test
- title: 🏗️ Build System
labels:
- build
- title: 🧹 CI/CD Changes
labels:
- ci
- title: ⏪ Reverts
labels:
- revert
- title: ❓ What is This
labels:
- '?'
change-template: '- $TITLE (#$NUMBER) by @$AUTHOR'
template: |
## 🔥 What's Changed
# 🔥 What's Changed
$CHANGES

54
.github/workflows/label-pr.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: Label PR Based on Conventional Commits
on:
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
label-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Analyze PR Title
id: analyze_title
run: |
pr_title="${{ github.event.pull_request.title }}"
label=""
# Match against Conventional Commits
if [[ "$pr_title" == feat* ]]; then
label="feat"
elif [[ "$pr_title" == fix* ]]; then
label="fix"
elif [[ "$pr_title" == chore* ]]; then
label="chore"
elif [[ "$pr_title" == docs* ]]; then
label="docs"
elif [[ "$pr_title" == style* ]]; then
label="style"
elif [[ "$pr_title" == refactor* ]]; then
label="refactor"
elif [[ "$pr_title" == perf* ]]; then
label="perf"
elif [[ "$pr_title" == test* ]]; then
label="test"
elif [[ "$pr_title" == build* ]]; then
label="build"
elif [[ "$pr_title" == ci* ]]; then
label="ci"
elif [[ "$pr_title" == revert* ]]; then
label="revert"
else
label="?"
fi
echo "label=$label" >> $GITHUB_ENV
- name: Add Label to PR
uses: actions-ecosystem/action-add-labels@v1
with:
labels: ${{ env.label }}
github_token: ${{ secrets.GITHUB_TOKEN }}