@@ -26,6 +26,41 @@ export function getStringArrayInput(
2626 . map ( ( value ) => value . trim ( ) ) ;
2727}
2828
29+ export function getBaseInputs (
30+ core : typeof Core ,
31+ mode : Parameters < typeof splitArgsIntoNxArgsAndOverrides > [ 1 ]
32+ ) : BaseInputs {
33+ const debug = core . getBooleanInput ( 'debug' ) ;
34+ const workingDirectory = core . getInput ( 'workingDirectory' ) ;
35+
36+ logger ( core ) . debugMode = debug ;
37+
38+ if ( workingDirectory ?. length > 0 ) {
39+ log ( `🏃 Working in custom directory: ${ workingDirectory } ` ) ;
40+ process . env . NX_WORKSPACE_ROOT_PATH = workingDirectory ;
41+ process . chdir ( workingDirectory ) ;
42+ }
43+
44+ return {
45+ args : getArgsInput ( core , mode ) ,
46+ debug,
47+ workingDirectory,
48+ } ;
49+ }
50+
51+ export function getArgsInput (
52+ core : typeof Core ,
53+ mode : Parameters < typeof splitArgsIntoNxArgsAndOverrides > [ 1 ] = 'print-affected' ,
54+ options ?: Core . InputOptions
55+ ) : NxArgs {
56+ const args = getStringArrayInput ( core , 'args' , / [ = ] / g, options ) ;
57+ const { nxArgs, overrides } = splitArgsIntoNxArgsAndOverrides ( { _ : args , $0 : '' } , mode , {
58+ printWarnings : false ,
59+ } ) ?? { nxArgs : { } , overrides : { } } ;
60+
61+ return parseNxArgs ( { ...nxArgs , ...overrides } ) ;
62+ }
63+
2964export function parseNxArgs ( args : Record < string , unknown > ) : NxArgs {
3065 const aliasArgs : Record < string , keyof NxArgs > = { c : 'configuration' } ;
3166 const arrArgs : ( keyof NxArgs ) [ ] = [ 'exclude' , 'projects' , 'files' ] ;
@@ -64,19 +99,6 @@ export function shouldRunWithDeps(target: string): boolean {
6499 }
65100}
66101
67- export function getArgsInput (
68- core : typeof Core ,
69- mode : Parameters < typeof splitArgsIntoNxArgsAndOverrides > [ 1 ] = 'print-affected' ,
70- options ?: Core . InputOptions
71- ) : NxArgs {
72- const args = getStringArrayInput ( core , 'args' , / [ = ] / g, options ) ;
73- const { nxArgs, overrides } = splitArgsIntoNxArgsAndOverrides ( { _ : args , $0 : '' } , mode , {
74- printWarnings : false ,
75- } ) ?? { nxArgs : { } , overrides : { } } ;
76-
77- return parseNxArgs ( { ...nxArgs , ...overrides } ) ;
78- }
79-
80102export function getMaxDistribution (
81103 core : typeof Core ,
82104 targets : string | string [ ] ,
@@ -112,25 +134,3 @@ export function getMaxDistribution(
112134
113135 return reduceTargetsDistribution ( maybeNumberValue ) ;
114136}
115-
116- export function getBaseInputs (
117- core : typeof Core ,
118- mode : Parameters < typeof splitArgsIntoNxArgsAndOverrides > [ 1 ]
119- ) : BaseInputs {
120- const debug = core . getBooleanInput ( 'debug' ) ;
121- const workingDirectory = core . getInput ( 'workingDirectory' ) ;
122-
123- logger ( core ) . debugMode = debug ;
124-
125- if ( workingDirectory ?. length > 0 ) {
126- log ( `🏃 Working in custom directory: ${ workingDirectory } ` ) ;
127- process . env . NX_WORKSPACE_ROOT_PATH = workingDirectory ;
128- process . chdir ( workingDirectory ) ;
129- }
130-
131- return {
132- args : getArgsInput ( core , mode ) ,
133- debug,
134- workingDirectory,
135- } ;
136- }
0 commit comments