chore: add github automations
This commit is contained in:
parent
1143bd3846
commit
4e0dbb3047
26
.github/release-drafter.yml
vendored
26
.github/release-drafter.yml
vendored
@ -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
|
||||||
|
|||||||
14
.github/workflows/auto-assign-author.yml
vendored
Normal file
14
.github/workflows/auto-assign-author.yml
vendored
Normal file
@ -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/auto-author-assign@v1.1.0
|
||||||
|
with:
|
||||||
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
44
.github/workflows/auto-label-conventional-commits.yaml
vendored
Normal file
44
.github/workflows/auto-label-conventional-commits.yaml
vendored
Normal file
@ -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…
x
Reference in New Issue
Block a user