Skip to content

Commit

Permalink
Don't notify author of change (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksnyder authored Sep 24, 2020
1 parent 0382fbd commit f784a0b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ func testableMain(stdout io.Writer, args []string) error {
return err
}

if opts.author != "" {
fmt.Fprintf(verbose, "Not notifying pull request author %s\n", opts.author)
delete(notifs, opts.author)
}

return opts.print(notifs)
}

Expand Down Expand Up @@ -104,6 +109,9 @@ type pullRequest struct {
Sha string `json:"sha"`
} `json:"head"`
NodeID string `json:"node_id"`
User struct {
Login string `json:"login"`
} `json:"User"`
}

func githubActionOptions() (*options, error) {
Expand Down Expand Up @@ -141,6 +149,7 @@ func githubActionOptions() (*options, error) {
format: "markdown",
baseRef: event.PullRequest.Base.Sha,
headRef: event.PullRequest.Head.Sha,
author: "@" + event.PullRequest.User.Login,
}
o.print = commentOnGitHubPullRequest(o, event.PullRequest.NodeID)
return o, nil
Expand Down Expand Up @@ -348,6 +357,7 @@ type options struct {
baseRef string
headRef string
format string
author string
print func(notifs map[string][]string) error
}

Expand Down

0 comments on commit f784a0b

Please sign in to comment.