From 4964a39b5ca718ec627408ea087523bd6bbbf08f Mon Sep 17 00:00:00 2001 From: sfwn Date: Wed, 10 Jul 2024 16:16:17 +0800 Subject: [PATCH] fix(release-fetch): fix compile error; add missing outputs in spec.yml --- actions/release-fetch/1.0/main.go | 7 ++----- actions/release-fetch/1.0/spec.yml | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/actions/release-fetch/1.0/main.go b/actions/release-fetch/1.0/main.go index 01c1d4aa..71d251e6 100644 --- a/actions/release-fetch/1.0/main.go +++ b/actions/release-fetch/1.0/main.go @@ -6,14 +6,12 @@ import ( "time" "encoding/json" - "github.com/erda-project/erda/pkg/parser/diceyml" "github.com/erda-project/erda/apistructs" "github.com/erda-project/erda/pkg/envconf" "github.com/erda-project/erda/pkg/http/httpclient" + "github.com/erda-project/erda/pkg/parser/diceyml" ) - - type Conf struct { ApplicationName string `env:"ACTION_APPLICATION_NAME" required:"true"` Branch string `env:"ACTION_BRANCH" required:"true"` @@ -48,7 +46,7 @@ func main() { panic(err) } - serviceInfo, err := GetServerInfo(release.Diceyml) + serviceInfo, err := GetServiceInfo(release.Diceyml) if err != nil { echoMeta("Error", err.Error()) panic(err) @@ -117,7 +115,6 @@ func getRelease(hc *httpclient.HTTPClient, appID string) (*apistructs.ReleaseDat return &resp.Data.Releases[0], nil } - func GetServiceInfo(data string) (string, error) { diceYaml, err := diceyml.New([]byte(data), false) if err != nil { diff --git a/actions/release-fetch/1.0/spec.yml b/actions/release-fetch/1.0/spec.yml index 6f56624d..d6d88373 100644 --- a/actions/release-fetch/1.0/spec.yml +++ b/actions/release-fetch/1.0/spec.yml @@ -19,6 +19,19 @@ outputs: - name: release_id desc: release id got from query + - name: release_name + - name: release_branch + - name: release_commit + - name: release_commit_message + - name: release_images + desc: |- + json format: + { + "svc_a": "image_a", + "svc_b": "image_b" + } + + accessibleAPIs: - path: /api/applications method: GET @@ -35,4 +48,4 @@ locale: en-US: desc: It is used to obtain the details of Erda products according to the ID - displayName: Get Release Detail \ No newline at end of file + displayName: Get Release Detail