40 lines
1.0 KiB
YAML
40 lines
1.0 KiB
YAML
name: "Auto Label Conventional Commits"
|
|
on:
|
|
issues:
|
|
types:
|
|
- reopened
|
|
- opened
|
|
pull_request:
|
|
types:
|
|
- reopened
|
|
- opened
|
|
jobs:
|
|
label_issues:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
issues: write
|
|
pull-requests: write
|
|
steps:
|
|
- name: Label issues
|
|
run: |
|
|
ISSUE_TITLE=$(gh issue view ${{ github.event.number }} --json title -q ".title")
|
|
if [[ $ISSUE_TITLE == chore:* ]]; then
|
|
gh issue edit ${{ github.event.number }} --add-label "type: chore"
|
|
elif [[ $ISSUE_TITLE == feat:* ]]; then
|
|
gh issue edit ${{ github.event.number }} --add-label "type: feat"
|
|
fi
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# const labelMapping = {
|
|
# 'feat:': 'type: feature request',
|
|
# 'perf:': 'type: enhancement',
|
|
# 'fix:': 'type: bug',
|
|
# 'docs:': 'type: documentation',
|
|
# 'ci:': 'type: ci',
|
|
# 'build:': 'type: ci',
|
|
# 'chore:': 'type: chore',
|
|
# 'test:': 'type: chore',
|
|
# 'style:': 'type: chore',
|
|
# 'refactor:': 'type: chore',
|
|
# };
|