From 20ac68ba4580325f2baa43abd516f8278a0c8347 Mon Sep 17 00:00:00 2001 From: icechen Date: Wed, 29 Dec 2021 21:22:42 +0800 Subject: [PATCH] fix HasPrefix --- config_handler/config_handler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config_handler/config_handler.go b/config_handler/config_handler.go index 29f0942..5f09ad5 100644 --- a/config_handler/config_handler.go +++ b/config_handler/config_handler.go @@ -65,6 +65,10 @@ func (p *plugin) Find(ctx context.Context, req *config.Request) (*drone.Config, } retData := destinationApi + "\n\n" + destinationService + n := strings.LastIndex(retData, "---") + if n > 0 { + retData = retData[:n] + } logrus.Info(retData) // 5. 组装所有ci信息并输出 return &drone.Config{