Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
debugging feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
thepwagner committed Nov 11, 2020
1 parent 9d3ec96 commit c07c691
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions actions/updateaction/repositorydispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ func (h *handler) repoDispatchActionUpdate(ctx context.Context, evt *github.Repo
branchName := h.branchNamer.Format(baseBranch, update)

var success bool
if payload.Feedback.Owner != "" {
if payload.Feedback.IssueNumber != 0 {
defer func() {
logrus.Info("sending feedback to provided issue")
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

// Search for the PR that was created:
gh := repo.NewGitHubClient(h.cfg.GitHubToken)
prList, _, err := gh.PullRequests.List(ctx, evt.GetRepo().GetOwner().GetName(), evt.GetRepo().GetName(), &github.PullRequestListOptions{
prList, _, err := gh.PullRequests.List(ctx, evt.GetRepo().GetOwner().GetLogin(), evt.GetRepo().GetName(), &github.PullRequestListOptions{
Head: branchName,
})
if err != nil {
Expand Down Expand Up @@ -75,6 +76,8 @@ func (h *handler) repoDispatchActionUpdate(ctx context.Context, evt *github.Repo
"path": update.Path,
"version": update.Next,
"branch": branchName,
"feedback_owner": payload.Feedback.Owner,
"feedback_namer": payload.Feedback.Name,
"feedback_issue": payload.Feedback.IssueNumber,
}).Debug("applying update from repository")
r, err := h.repo()
Expand Down

0 comments on commit c07c691

Please sign in to comment.