Fix regression of #4119 (#4121)

This commit is contained in:
6543 2024-09-17 06:46:31 +02:00 committed by GitHub
parent 375309a8a8
commit 4683968925
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -45,7 +45,7 @@ func metadataFromContext(_ context.Context, c *cli.Command, axis matrix.Axis) (m
var changedFiles []string
changedFilesRaw := c.String("pipeline-files")
if changedFilesRaw[0] == '[' {
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)
}