File tree 1 file changed +10
-0
lines changed 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change
1
+ const readEnv = ( variable ) => {
2
+ const val = process . env [ variable ] ;
3
+ if ( val === undefined || val . length === 0 ) return undefined ;
4
+ return val ;
5
+ } ;
6
+
1
7
const mustReadEnv = ( variable ) => {
2
8
const val = process . env [ variable ] ;
3
9
if ( val === undefined || val . length === 0 ) {
@@ -21,6 +27,8 @@ function readInt(variable) {
21
27
22
28
export function configuration ( ) {
23
29
const defaultDelay = 3600 ;
30
+ const defaultInclude = "*" ;
31
+ const defaultExclude = "" ;
24
32
const config = {
25
33
github : {
26
34
username : mustReadEnv ( "GITHUB_USERNAME" ) ,
@@ -34,6 +42,8 @@ export function configuration() {
34
42
} ,
35
43
dryRun : readBoolean ( "DRY_RUN" ) ,
36
44
delay : readInt ( "DELAY" ) ?? defaultDelay ,
45
+ include : ( readEnv ( "INCLUDE" ) ?? defaultInclude ) . split ( "," ) . map ( f => f . trim ( ) ) ,
46
+ exclude : ( readEnv ( "EXCLUDE" ) ?? defaultExclude ) . split ( "," ) . map ( f => f . trim ( ) ) ,
37
47
} ;
38
48
39
49
if ( config . github . privateRepositories && config . github . token === undefined ) {
You can’t perform that action at this time.
0 commit comments