File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ type GithubActionsJob struct {
172
172
Env GithubActionsEnvs `json:"env,omitempty"`
173
173
Steps GithubActionsSteps `json:"steps"`
174
174
ReferencesSecrets []string `json:"references_secrets" yaml:"-"`
175
+ Strategy GithubActionsStrategy `json:"strategy,omitempty" yaml:"strategy"`
175
176
Line int `json:"line" yaml:"-"`
176
177
177
178
Lines map [string ]int `json:"lines" yaml:"-"`
@@ -545,3 +546,26 @@ func (o *GithubActionsJobEnvironments) UnmarshalYAML(node *yaml.Node) error {
545
546
* o = GithubActionsJobEnvironments {env }
546
547
return nil
547
548
}
549
+
550
+ type GithubActionsStrategy struct {
551
+ Matrix map [string ]StringList `json:"matrix,omitempty" yaml:"matrix"`
552
+ }
553
+
554
+ // UnmarshalYAML parses the `strategy` block and extracts `matrix`
555
+ func (o * GithubActionsStrategy ) UnmarshalYAML (node * yaml.Node ) error {
556
+ if node .Kind != yaml .MappingNode {
557
+ return fmt .Errorf ("invalid yaml node type for strategy" )
558
+ }
559
+ for i := 0 ; i < len (node .Content ); i += 2 {
560
+ key := node .Content [i ].Value
561
+ value := node .Content [i + 1 ]
562
+ if key == "matrix" {
563
+ var m map [string ]StringList
564
+ if err := value .Decode (& m ); err != nil {
565
+ return err
566
+ }
567
+ o .Matrix = m
568
+ }
569
+ }
570
+ return nil
571
+ }
You can’t perform that action at this time.
0 commit comments