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 610bbcb commit 38e1ebc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/gh/changelog.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package gh

import (
"fmt"
"github.com/cuisongliu/logger"
"github.com/labring-actions/gh-rebot/pkg/config"
"github.com/labring-actions/gh-rebot/pkg/utils"
"k8s.io/client-go/util/retry"
Expand All @@ -28,14 +29,17 @@ type RetryShell string

var execFn = func(shells []any) error {
for _, sh := range shells {
if s, ok := sh.(RetryShell); ok {
logger.Debug("retry shell: %s", s)
return retry.RetryOnConflict(retry.DefaultRetry, func() error {
return utils.RunCommand("bash", "-c", string(s))
})
}
if s, ok := sh.(string); ok {
logger.Debug("once shell: %s", s)
if err := utils.RunCommand("bash", "-c", s); err != nil {
return err
}
} else if s, ok := sh.(RetryShell); ok {
return retry.RetryOnConflict(retry.DefaultRetry, func() error {
return utils.RunCommand("bash", "-c", string(s))
})
}
}
return nil
Expand Down

0 comments on commit 38e1ebc

Please sign in to comment.