File tree 1 file changed +18
-4
lines changed
1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,17 @@ export enum DangerCheckCode {
45
45
* Expected type signature for danger checks - split into two types to make
46
46
* it more convenient when defining a function with DangerCheck.
47
47
*/
48
- export type DangerCheck = ( ) =>
49
- | ( DangerCheck | void )
50
- | Promise < DangerCheckCode | void > ;
48
+ interface DangerCheckArgs {
49
+ fail : typeof fail ;
50
+ markdown : typeof markdown ;
51
+ danger : typeof danger ;
52
+ message : typeof message ;
53
+ warn : typeof warn ;
54
+ }
55
+
56
+ export type DangerCheck = (
57
+ args : DangerCheckArgs ,
58
+ ) => ( DangerCheck | void ) | Promise < DangerCheckCode | void > ;
51
59
52
60
type DangerCheckEntry = [ description : string , DangerCheck ] ;
53
61
@@ -92,7 +100,13 @@ async function runAllChecks() {
92
100
const mergedChecks = [ ...localChecks , ...checks ] ;
93
101
94
102
for ( const [ description , check ] of mergedChecks ) {
95
- const result = await check ( ) ;
103
+ const result = await check ( {
104
+ danger,
105
+ fail,
106
+ markdown,
107
+ message,
108
+ warn,
109
+ } ) ;
96
110
97
111
/**
98
112
* Handle special cases for check return values; the default behavior is
You can’t perform that action at this time.
0 commit comments