Skip to content

Commit

Permalink
Merge pull request #23 from mach6/master
Browse files Browse the repository at this point in the history
Fix #22 - 3 dots in yaml are replaced
  • Loading branch information
foosinn authored May 26, 2020
2 parents 13b4955 + bb619aa commit e26caba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,14 @@ func (p *Plugin) Find(ctx context.Context, droneRequest *config.Request) (*drone
}

// cleanup
configData = strings.ReplaceAll(configData, "...", "")
configData = string(removeDocEndRegex.ReplaceAllString(configData, ""))
configData = string(dedupRegex.ReplaceAll([]byte(configData), []byte("---")))

return &drone.Config{Data: configData}, nil
}

var dedupRegex = regexp.MustCompile(`(?ms)(---[\s]*){2,}`)
var removeDocEndRegex = regexp.MustCompile(`(?ms)^(\.\.\.)$`)

// droneConfigAppend concats multiple 'drone.yml's to a multi-machine pipeline
// see https://docs.drone.io/user-guide/pipeline/multi-machine/
Expand Down

0 comments on commit e26caba

Please sign in to comment.