Merge pull request #809 from janhq/workflows

chore: add gi automations
This commit is contained in:
0xSage 2023-12-01 14:56:53 +08:00 committed by GitHub
commit ea6af7f9a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 66 additions and 14 deletions

View File

@ -1,20 +1,18 @@
categories: categories:
- title: '🚀 Features' - title: "🚀 Features"
labels: labels:
- 'type: enhancement' - "type: feature request"
- 'type: epic' - "type: enhancement"
- 'type: feature request' - "type: epic"
- title: '🐛 Bug Fixes' - title: "🐛 Fixes"
labels: labels:
- 'type: bug' - "type: bug"
- title: '🧰 Maintenance' - title: "🧰 Maintenance"
labels: labels:
- 'type: chore' - "type: chore"
- 'type: ci' - "type: ci"
- title: '📖 Documentaion' - "type: documentation"
labels: change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
- 'type: documentation'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
template: | template: |
## Changes ## Changes

View File

@ -0,0 +1,14 @@
# Auto assign author, tags, and reviewers to pull requests
name: "Auto Assign Author"
on:
pull_request:
types: [opened]
jobs:
assign-author:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: toshimaru/auto-author-assign@v1.1.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

View File

@ -0,0 +1,40 @@
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: Checkout
uses: actions/checkout@v4
- name: Label issues
run: |
ISSUE_TITLE=$(gh issue view ${{ github.event.number }} --json title -q ".title")
case "$ISSUE_TITLE" in
chore:*) LABEL="type: chore" ;;
feat:*) LABEL="type: feature request" ;;
perf:*) LABEL="type: enhancement" ;;
fix:*) LABEL="type: bug" ;;
docs:*) LABEL="type: documentation" ;;
ci:*) LABEL="type: ci" ;;
build:*) LABEL="type: ci" ;;
test:*) LABEL="type: chore" ;;
style:*) LABEL="type: chore" ;;
refactor:*) LABEL="type: chore" ;;
*) LABEL="" ;;
esac
if [ -n "$LABEL" ]; then
gh issue edit ${{ github.event.number }} --add-label "$LABEL"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}