Skip to content

Commit

Permalink
add pipeline for release
Browse files Browse the repository at this point in the history
  • Loading branch information
cuisongliu committed Apr 18, 2023
1 parent 96c7408 commit 43a87a7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/gh/check_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/labring-actions/gh-rebot/pkg/utils"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/util/json"
"strings"
"time"
)

Expand All @@ -35,12 +36,13 @@ type ActionOut struct {
}

func CheckRelease(tagName string) (*ActionOut, error) {
workflowOutput, err := utils.RunCommandWithOutput(fmt.Sprintf(gitWorkflowCheck, config.GlobalsConfig.Release.Action, tagName), true)
if err != nil {
return nil, err
workflowOutput, _ := utils.RunCommandWithOutput(fmt.Sprintf(gitWorkflowCheck, config.GlobalsConfig.Release.Action, tagName), true)
if workflowOutput == "" || strings.Contains(workflowOutput, "could not find any workflows named") {
time.Sleep(5 * time.Second)
return CheckRelease(tagName)
}
var out ActionOut
if err = json.Unmarshal([]byte(workflowOutput), &out); err != nil {
if err := json.Unmarshal([]byte(workflowOutput), &out); err != nil {
return nil, err
}
if out.Conclusion == "success" && out.Status == "completed" {
Expand Down

0 comments on commit 43a87a7

Please sign in to comment.