Deprecate secrets in favor of from_secret (#4360)

This commit is contained in:
6543 2024-11-18 21:26:46 +01:00 committed by GitHub
parent aa7e1cdd9e
commit 2cbd9268f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -186,10 +186,10 @@ func (l *Linter) lintContainerDeprecations(config *WorkflowConfig, c *types.Cont
}) })
} }
if c.Secrets.LegacyFormat { if len(c.Secrets.Secrets) != 0 {
err = multierr.Append(err, &errorTypes.PipelineError{ err = multierr.Append(err, &errorTypes.PipelineError{
Type: errorTypes.PipelineErrorTypeDeprecation, Type: errorTypes.PipelineErrorTypeDeprecation,
Message: "Alternative names syntax for `secrets` is deprecated, use list syntax or `from_secret` instead", Message: "Secrets are deprecated, use environment with from_secret",
Data: errors.DeprecationErrorData{ Data: errors.DeprecationErrorData{
File: config.File, File: config.File,
Field: fmt.Sprintf("%s.%s.secrets", field, c.Name), Field: fmt.Sprintf("%s.%s.secrets", field, c.Name),

View file

@ -175,7 +175,7 @@ func TestLintErrors(t *testing.T) {
}, },
{ {
from: "steps: { build: { image: golang, secrets: [ { source: mysql_username, target: mysql_username } ] } }", from: "steps: { build: { image: golang, secrets: [ { source: mysql_username, target: mysql_username } ] } }",
want: "Alternative names syntax for `secrets` is deprecated, use list syntax or `from_secret` instead", want: "Secrets are deprecated, use environment with from_secret",
}, },
} }