Skip to content
name: "Auto Label Conventional Commits"
on:
issues:
- reopened
- opened
pull_request:
- 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.issue.number }} --json title -q ".title")
if [[ $ISSUE_TITLE == chore* ]]; then
gh issue edit ${{ github.event.issue.number }} --add-label "type: chore"
elif [[ $ISSUE_TITLE == feat* ]]; then
gh issue edit ${{ github.event.issue.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',
# };