Skip to content

Commit

Permalink
fix(release-fetch): fix compile error; add missing outputs in spec.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sfwn committed Jul 10, 2024
1 parent afcc1e8 commit 4964a39
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
7 changes: 2 additions & 5 deletions actions/release-fetch/1.0/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down
15 changes: 14 additions & 1 deletion actions/release-fetch/1.0/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
displayName: Get Release Detail

0 comments on commit 4964a39

Please sign in to comment.