style: reenable switch check
This commit is contained in:
parent
adf4dcdbbf
commit
8322882265
19 changed files with 29 additions and 43 deletions
|
@ -83,12 +83,9 @@ func (entry *Workflow) Dispatch(ctx context.Context, inputGetter InputValueGette
|
|||
}
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
switch input.Type {
|
||||
case "boolean":
|
||||
// Since "boolean" inputs are rendered as a checkbox in html, the value inside the form is "on"
|
||||
val = strconv.FormatBool(val == "on")
|
||||
}
|
||||
} else if input.Type == "boolean" {
|
||||
// Since "boolean" inputs are rendered as a checkbox in html, the value inside the form is "on"
|
||||
val = strconv.FormatBool(val == "on")
|
||||
}
|
||||
inputs[key] = val
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ func (h *UnsubscribeHandler) Handle(ctx context.Context, _ *MailContent, doer *u
|
|||
}
|
||||
|
||||
return issues_model.CreateOrUpdateIssueWatch(ctx, doer.ID, issue.ID, false)
|
||||
default:
|
||||
return fmt.Errorf("unsupported unsubscribe reference: %v", ref)
|
||||
}
|
||||
|
||||
return fmt.Errorf("unsupported unsubscribe reference: %v", ref)
|
||||
}
|
||||
|
|
|
@ -160,8 +160,7 @@ func (dc dingtalkConvertor) PullRequest(p *api.PullRequestPayload) (DingtalkPayl
|
|||
// Review implements PayloadConvertor Review method
|
||||
func (dc dingtalkConvertor) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (DingtalkPayload, error) {
|
||||
var text, title string
|
||||
switch p.Action {
|
||||
case api.HookIssueReviewed:
|
||||
if p.Action == api.HookIssueReviewed {
|
||||
action, err := parseHookPullRequestEventType(event)
|
||||
if err != nil {
|
||||
return DingtalkPayload{}, err
|
||||
|
|
|
@ -215,8 +215,7 @@ func (d discordConvertor) PullRequest(p *api.PullRequestPayload) (DiscordPayload
|
|||
func (d discordConvertor) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (DiscordPayload, error) {
|
||||
var text, title string
|
||||
var color int
|
||||
switch p.Action {
|
||||
case api.HookIssueReviewed:
|
||||
if p.Action == api.HookIssueReviewed {
|
||||
action, err := parseHookPullRequestEventType(event)
|
||||
if err != nil {
|
||||
return DiscordPayload{}, err
|
||||
|
|
|
@ -237,8 +237,7 @@ func (m matrixConvertor) Review(p *api.PullRequestPayload, event webhook_module.
|
|||
repoLink := htmlLinkFormatter(p.Repository.HTMLURL, p.Repository.FullName)
|
||||
var text string
|
||||
|
||||
switch p.Action {
|
||||
case api.HookIssueReviewed:
|
||||
if p.Action == api.HookIssueReviewed {
|
||||
action, err := parseHookPullRequestEventType(event)
|
||||
if err != nil {
|
||||
return MatrixPayload{}, err
|
||||
|
|
|
@ -225,8 +225,7 @@ func (m msteamsConvertor) PullRequest(p *api.PullRequestPayload) (MSTeamsPayload
|
|||
func (m msteamsConvertor) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (MSTeamsPayload, error) {
|
||||
var text, title string
|
||||
var color int
|
||||
switch p.Action {
|
||||
case api.HookIssueReviewed:
|
||||
if p.Action == api.HookIssueReviewed {
|
||||
action, err := parseHookPullRequestEventType(event)
|
||||
if err != nil {
|
||||
return MSTeamsPayload{}, err
|
||||
|
|
|
@ -289,8 +289,7 @@ func (s slackConvertor) Review(p *api.PullRequestPayload, event webhook_module.H
|
|||
repoLink := SlackLinkFormatter(p.Repository.HTMLURL, p.Repository.FullName)
|
||||
var text string
|
||||
|
||||
switch p.Action {
|
||||
case api.HookIssueReviewed:
|
||||
if p.Action == api.HookIssueReviewed {
|
||||
action, err := parseHookPullRequestEventType(event)
|
||||
if err != nil {
|
||||
return SlackPayload{}, err
|
||||
|
|
|
@ -164,8 +164,7 @@ func (t telegramConvertor) PullRequest(p *api.PullRequestPayload) (TelegramPaylo
|
|||
// Review implements PayloadConvertor Review method
|
||||
func (t telegramConvertor) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (TelegramPayload, error) {
|
||||
var text, attachmentText string
|
||||
switch p.Action {
|
||||
case api.HookIssueReviewed:
|
||||
if p.Action == api.HookIssueReviewed {
|
||||
action, err := parseHookPullRequestEventType(event)
|
||||
if err != nil {
|
||||
return TelegramPayload{}, err
|
||||
|
|
|
@ -154,8 +154,7 @@ func (wc wechatworkConvertor) PullRequest(p *api.PullRequestPayload) (Wechatwork
|
|||
// Review implements PayloadConvertor Review method
|
||||
func (wc wechatworkConvertor) Review(p *api.PullRequestPayload, event webhook_module.HookEventType) (WechatworkPayload, error) {
|
||||
var text, title string
|
||||
switch p.Action {
|
||||
case api.HookIssueReviewed:
|
||||
if p.Action == api.HookIssueReviewed {
|
||||
action, err := parseHookPullRequestEventType(event)
|
||||
if err != nil {
|
||||
return WechatworkPayload{}, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue