Supports GitHub and Bitbucket Cloud.
Still under development
- Install Danger JS
$ npm install -g danger
- Adding
danger_core
todev_dependencies
dev_dependencies:
danger_core:
- Create
dangerfile.dart
// @dart=2.10
import 'package:danger_core/danger_core.dart';
void main() {
if (danger.github.pr.title.contains('WIP')) {
warn('PR is considered WIP');
}
}
For GithubAction, you need to set GITHUB_TOKEN as environment example
- name: Run danger ci
run: danger_dart ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
danger_dart ci
- Use this on CIdanger_dart pr https://github.com/Moya/Harvey/pull/23
- Use this to build your Dangerfiledanger_dart local
- Use this to run danger against your local changes from master
Check the Debugging doc.
We can use pub global activate
to enable command danger_dart
.
$ pub global activate --source path packages/danger_dart/
Or using dart
to run directly.
$ dart packages/danger_dart/bin/danger_dart.dart ci
$ dart packages/danger_dart/bin/danger_dart.dart pr https://github.com/Moya/Harvey/pull/23
$ dart packages/danger_dart/bin/danger_dart.dart local
You can create your own plugin using command
$ dart create -t package-simple <plugin_name>
In pubspec.yaml
put danger_core
in dependences
dependencies:
danger_core:
For more information, see the example https://github.com/danger/dart/tree/master/packages/danger_plugin_dart_test