ci: add danger

This commit is contained in:
H01001000
2023-12-08 13:38:20 -08:00
parent d81b28a24b
commit 22e376b158
4 changed files with 875 additions and 7 deletions

13
.github/workflows/danger.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
name: Node CI
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: danger/danger-js@11
with:
args: --text-only
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

11
dangerfile.ts Normal file
View File

@@ -0,0 +1,11 @@
import { danger, message } from 'danger'
const commitType = ['build', 'chore', 'ci', 'docs', 'style', 'refactor', 'perf', 'test']
if (!commitType.find((type) => danger.github.pr.title.startsWith(type))) {
message(`This pull request title should start with either ${commitType.join(', ')}.`)
}
if (!danger.github.pr.assignee) {
message('This pull request needs an assignee.')
}

View File

@@ -29,6 +29,7 @@
},
"devDependencies": {
"chokidar-cli": "^3.0.0",
"danger": "^11.3.1",
"eslint": "^8.54.0",
"eslint-config-discordeno": "*",
"husky": "^8.0.3",

857
yarn.lock

File diff suppressed because it is too large Load Diff