Skip to content

Commit

Permalink
add-manifest-env
Browse files Browse the repository at this point in the history
  • Loading branch information
Samra Belachew committed Oct 24, 2023
1 parent 8125a44 commit fce4fe8
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion server/neptune/gateway/pr/signaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,27 @@ func (s *WorkflowSignaler) buildRoots(rootCfgs []*valid.MergedProjectCfg, valida
RepoRelPath: rootCfg.RepoRelDir,
TfVersion: tfVersion,
PlanMode: generatePlanMode(rootCfg),
Plan: workflows.PRJob{Steps: generateSteps(rootCfg.PullRequestWorkflow.Plan.Steps)},
Plan: workflows.PRJob{Steps: s.prependPlanEnvSteps(rootCfg)},
Validate: workflows.PRJob{Steps: s.prependValidateEnvSteps(rootCfg, validateEnvOpts...)},
})
}
return roots
}

func (s *WorkflowSignaler) prependPlanEnvSteps(cfg *valid.MergedProjectCfg) []workflows.PRStep {
var steps []workflows.PRStep
if t, ok := cfg.Tags[Manifest]; ok {
//this is a Lyft specific env var
steps = append(steps, workflows.PRStep{
StepName: EnvStep,
EnvVarName: "MANIFEST_FILEPATH",
EnvVarValue: t,
})
}
steps = append(steps, generateSteps(cfg.PullRequestWorkflow.Plan.Steps)...)
return steps
}

func (s *WorkflowSignaler) prependValidateEnvSteps(rootCfg *valid.MergedProjectCfg, opts ...ValidateEnvs) []workflows.PRStep {
for _, o := range opts {
initialEnvSteps := s.generatePRModeEnvSteps(rootCfg, o)
Expand Down

0 comments on commit fce4fe8

Please sign in to comment.