Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add Github automations #806

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
categories:
- title: '🚀 Features'
- title: "🚀 Features"
labels:
- 'type: enhancement'
- 'type: epic'
- 'type: feature request'
- title: '🐛 Bug Fixes'
- "type: feature request"
- "type: enhancement"
- "type: epic"
- title: "🐛 Fixes"
labels:
- 'type: bug'
- title: '🧰 Maintenance'
labels:
- 'type: chore'
- 'type: ci'
- title: '📖 Documentaion'
labels:
- 'type: documentation'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
- "type: bug"
- title: "🧰 Maintenance"
labels:
- "type: chore"
- "type: ci"
- "type: documentation"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
template: |
## Changes
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/auto-assign-author.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Auto assign author, tags, and reviewers to pull requests
name: "Auto Author Assign"
on:
pull_request:
types: [opened]
permissions:
pull-requests: write
jobs:
assign-author:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
44 changes: 44 additions & 0 deletions .github/workflows/auto-label-conventional-commits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Auto Label Conventional Commits"
on:
issues:
types: [opened]
pull_request:
types: [opened]

permissions:
issues: write
pull-requests: write

jobs:
label_issues:
runs-on: ubuntu-latest
steps:
- name: Label issue
uses: actions/github-script@v5
with:
script: |
const title = context.payload.issue ? context.payload.issue.title : context.payload.pull_request.title;
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',
};
for (const [prefix, label] of Object.entries(labelMapping)) {
if (title.startsWith(prefix)) {
const issue_number = context.payload.issue ? context.issue.number : context.payload.pull_request.number;
github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
labels: [label],
});
break;
}
}
Loading