File tree Expand file tree Collapse file tree 1 file changed +24
-4
lines changed Expand file tree Collapse file tree 1 file changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,16 @@ internals.parseActionsSetupNode = function * (workflow, file) {
3232
3333 const envMatch = nodeVersion . match ( / ^ \$ { { \s + e n v .(?< envVarName > .* ) \s + } } $ / ) ;
3434 if ( envMatch ) {
35- const envValue = workflow . env [ envMatch . groups . envVarName ] ;
35+ const env = {
36+ ...workflow . env ,
37+ ...step . env
38+ } ;
39+ const envValue = env [ envMatch . groups . envVarName ] ;
40+
41+ if ( ! envValue ) {
42+ yield 'not-set' ;
43+ continue ;
44+ }
3645
3746 yield envValue ;
3847 continue ;
@@ -68,15 +77,26 @@ internals.parseLjharbActions = function * (workflow, file) {
6877 const matrixMatch = nodeVersion . match ( / ^ \$ { { \s + m a t r i x .(?< matrixVarName > .* ) \s + } } $ / ) ;
6978 if ( matrixMatch ) {
7079
80+ let needs = job . strategy . matrix ;
7181 if ( typeof job . strategy . matrix !== 'string' ) {
7282
7383 const matrix = job . strategy . matrix [ matrixMatch . groups . matrixVarName ] ;
7484
75- yield * matrix ;
76- continue ;
85+ if ( ! matrix ) {
86+ throw new Error ( `Unable to find matrix variable '${ matrixMatch . groups . matrixVarName } ' in the matrix in ${ file } ` ) ;
87+ }
88+
89+ if ( typeof matrix !== 'string' ) {
90+ // @todo find an example
91+ yield * matrix ;
92+ continue ;
93+ }
94+
95+ // example: eslint-plugin-react
96+ needs = matrix ;
7797 }
7898
79- const fromJsonMatch = job . strategy . matrix . match ( / ^ \$ { { \s + f r o m J s o n \( n e e d s \. (?< needJobName > .* ) \. o u t p u t s \. (?< needOutputName > .* ) \) \s + } } $ / ) ;
99+ const fromJsonMatch = needs . match ( / ^ \$ { { \s + f r o m J s o n \( n e e d s \. (?< needJobName > .* ) \. o u t p u t s \. (?< needOutputName > .* ) \) \s + } } $ / ) ;
80100 if ( fromJsonMatch ) {
81101 const { needJobName, needOutputName } = fromJsonMatch . groups ;
82102 const needJob = workflow . jobs [ needJobName ] ;
You can’t perform that action at this time.
0 commit comments