Skip to content

Commit

Permalink
Merge pull request #5925 from devtron-labs/auto-ci-trigger-fix
Browse files Browse the repository at this point in the history
fix: nil ptr fix in copying extraEnvVars
  • Loading branch information
gireesh-naidu authored and Shivam-nagar23 committed Oct 2, 2024
1 parent 0b51ad3 commit e17c52e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/pipeline/CiService.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ func (impl *CiServiceImpl) TriggerCiPipeline(trigger types.Trigger) (int, error)
impl.Logger.Errorw("error in getting gitTrigger env data for stage", "gitTriggers", savedCiWf.GitTriggers, "err", err)
return 0, err
}
if trigger.ExtraEnvironmentVariables == nil {
trigger.ExtraEnvironmentVariables = make(map[string]string)
}
maps.Copy(trigger.ExtraEnvironmentVariables, gitTriggerEnvVariables)

workflowRequest, err := impl.buildWfRequestForCiPipeline(pipeline, trigger, ciMaterials, savedCiWf, ciWorkflowConfig, ciPipelineScripts, preCiSteps, postCiSteps, refPluginsData, isJob)
Expand Down

0 comments on commit e17c52e

Please sign in to comment.