name: "Auto Label Conventional Commits" on: issues: types: - reopened - opened pull_request: types: - reopened - opened - edited jobs: label_issues: runs-on: ubuntu-latest permissions: issues: write pull-requests: write steps: - name: Checkout uses: actions/checkout@v4 - 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', # };