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) {
32
32
33
33
const envMatch = nodeVersion . match ( / ^ \$ { { \s + e n v .(?< envVarName > .* ) \s + } } $ / ) ;
34
34
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
+ }
36
45
37
46
yield envValue ;
38
47
continue ;
@@ -68,15 +77,26 @@ internals.parseLjharbActions = function * (workflow, file) {
68
77
const matrixMatch = nodeVersion . match ( / ^ \$ { { \s + m a t r i x .(?< matrixVarName > .* ) \s + } } $ / ) ;
69
78
if ( matrixMatch ) {
70
79
80
+ let needs = job . strategy . matrix ;
71
81
if ( typeof job . strategy . matrix !== 'string' ) {
72
82
73
83
const matrix = job . strategy . matrix [ matrixMatch . groups . matrixVarName ] ;
74
84
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 ;
77
97
}
78
98
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 + } } $ / ) ;
80
100
if ( fromJsonMatch ) {
81
101
const { needJobName, needOutputName } = fromJsonMatch . groups ;
82
102
const needJob = workflow . jobs [ needJobName ] ;
You can’t perform that action at this time.
0 commit comments