cli exec: rename "--pipeline-files" to "--pipeline-changed-files" (#4142)

This commit is contained in:
6543 2024-09-24 20:29:19 +02:00 committed by GitHub
parent 352201dbbd
commit b59533a06f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -235,7 +235,7 @@ var flags = []cli.Flag{
&cli.StringFlag{ &cli.StringFlag{
Sources: cli.EnvVars("CI_PIPELINE_FILES"), Sources: cli.EnvVars("CI_PIPELINE_FILES"),
Usage: "Set the metadata environment variable \"CI_PIPELINE_FILES\", either json formatted list of strings, or comma separated string list.", Usage: "Set the metadata environment variable \"CI_PIPELINE_FILES\", either json formatted list of strings, or comma separated string list.",
Name: "pipeline-files", Name: "pipeline-changed-files",
}, },
&cli.StringFlag{ &cli.StringFlag{
Sources: cli.EnvVars("CI_COMMIT_SHA"), Sources: cli.EnvVars("CI_COMMIT_SHA"),

View file

@ -44,10 +44,10 @@ func metadataFromContext(_ context.Context, c *cli.Command, axis matrix.Axis) (m
} }
var changedFiles []string var changedFiles []string
changedFilesRaw := c.String("pipeline-files") changedFilesRaw := c.String("pipeline-changed-files")
if len(changedFilesRaw) != 0 && changedFilesRaw[0] == '[' { if len(changedFilesRaw) != 0 && changedFilesRaw[0] == '[' {
if err := json.Unmarshal([]byte(changedFilesRaw), &changedFiles); err != nil { if err := json.Unmarshal([]byte(changedFilesRaw), &changedFiles); err != nil {
return metadata.Metadata{}, fmt.Errorf("pipeline-files detected json but could not parse it: %w", err) return metadata.Metadata{}, fmt.Errorf("pipeline-changed-files detected json but could not parse it: %w", err)
} }
} else { } else {
for _, file := range strings.Split(changedFilesRaw, ",") { for _, file := range strings.Split(changedFilesRaw, ",") {