Skip to content

Commit

Permalink
[GH-733] Updated the "issue_creations" subscription to post notificat…
Browse files Browse the repository at this point in the history
…ion when an issue is labeled/reopened (#736)

* [MM-177] Updated the "issue_creations" subscription to post notification when a issue is labelled

* [MM-201] Review fix
  • Loading branch information
raghavaggarwal2308 authored Mar 8, 2024
1 parent aa1faef commit 73c5db9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions server/plugin/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func validateFeatures(features []string) (bool, []string) {
if valid && hasLabel {
// must have "pulls" or "issues" in features when using a label
for _, f := range features {
if f == featurePulls || f == featureIssues {
if f == featurePulls || f == featureIssues || f == featureIssueCreation {
return valid, invalidFeatures
}
}
Expand Down Expand Up @@ -415,7 +415,7 @@ func (p *Plugin) handleSubscribesAdd(_ *plugin.Context, args *model.CommandArgs,
if !ok {
msg := fmt.Sprintf("Invalid feature(s) provided: %s", strings.Join(ifs, ","))
if len(ifs) == 0 {
msg = "Feature list must have \"pulls\" or \"issues\" when using a label."
msg = "Feature list must have \"pulls\", \"issues\" or \"issue_creations\" when using a label."
}
return msg
}
Expand Down
2 changes: 1 addition & 1 deletion server/plugin/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ func (p *Plugin) postIssueEvent(event *github.IssuesEvent) {
continue
}

if sub.IssueCreations() && action != actionOpened {
if sub.IssueCreations() && action != actionOpened && action != actionReopened && action != actionLabeled {
continue
}

Expand Down

0 comments on commit 73c5db9

Please sign in to comment.