1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-24 10:07:21 +02:00

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{
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.",
Name: "pipeline-files",
Name: "pipeline-changed-files",
},
&cli.StringFlag{
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
changedFilesRaw := c.String("pipeline-files")
changedFilesRaw := c.String("pipeline-changed-files")
if len(changedFilesRaw) != 0 && changedFilesRaw[0] == '[' {
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 {
for _, file := range strings.Split(changedFilesRaw, ",") {