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

Danger #50

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
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
17 changes: 17 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Danger

on: [pull_request]

jobs:
danger:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Danger
uses: danger/[email protected]
with:
args: '--dangerfile ./.github/workflows/js/dangerfile.ts --use-github-checks'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/js/dangerfile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { danger, fail } from 'danger';
// import yarn from 'danger-plugin-yarn'
// import jest from "danger-plugin-jest"

export default async () => {
if (danger.git) {
const match = danger.git.fileMatch('.github/**/dangerfile.ts');
if (match.edited) {
const file = match.getKeyedPaths().edited[0]
fail('This dangerfile is not ready yet.', file, 0);
}
else
fail('This dangerfile is not ready yet. Location is unknown.');
} else {
fail('PR does not exist');
}

// await yarn();
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"@types/node": "^12.7.4",
"@types/react": "^16.7.22",
"@types/styled-components": "^4.1.6",
"danger": "^9.1.8",
"danger-plugin-jest": "^1.3.0",
"danger-plugin-yarn": "^1.3.2",
"jest": "^24.1.0",
"jest-specific-snapshot": "^2.0.0",
"ts-jest": "24.0.0",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es2015",
"target": "es2016",
/* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
"module": "commonjs",
/* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */
Expand Down
Loading