Pass netrc to trusted clone images (#2163)

closes #1975
This commit is contained in:
Anbraten 2023-08-08 12:49:29 +02:00 committed by GitHub
parent 3bdeb47d8c
commit f02eaa115e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -237,6 +237,14 @@ func (c *Compiler) Compile(conf *yaml_types.Workflow) (*backend_types.Config, er
stepType = backend_types.StepTypePlugin
}
step := c.createProcess(name, container, stepType)
// inject netrc if it's a trusted repo or a trusted clone-plugin
if c.trustedPipeline || (container.IsPlugin() && container.IsTrustedCloneImage()) {
for k, v := range c.cloneEnv {
step.Environment[k] = v
}
}
stage.Steps = append(stage.Steps, step)
}