Skip to content

Commit

Permalink
Update issue in IssueRepo when change detected
Browse files Browse the repository at this point in the history
This was trying (and depending on app permissions, succeeding) at changing issue descriptions in repos directly even when IssueRepo was set. We update to obey IssueRepo config setting in this case

Signed-off-by: twelsh-aw <84401379+twelsh-aw@users.noreply.github.com>
  • Loading branch information
twelsh-aw authored and jeffmendoza committed Mar 27, 2024
1 parent 964a34c commit c26edb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/issue/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func ensure(ctx context.Context, c *github.Client, issues issues, owner, repo, p
if !strings.Contains(issue.GetBody(), hash) && hasIssueSection(issue.GetBody(), updateSectionName) {
// Comment update and update issue body
commentBody := fmt.Sprintf("The policy result has been updated.\n\n---\n\n%s", text)
comment, _, err := issues.CreateComment(ctx, owner, repo, issue.GetNumber(), &github.IssueComment{
comment, _, err := issues.CreateComment(ctx, owner, issueRepo, issue.GetNumber(), &github.IssueComment{
Body: &commentBody,
})
if err != nil {
Expand All @@ -159,7 +159,7 @@ func ensure(ctx context.Context, c *github.Client, issues issues, owner, repo, p
}
// Ensure issue is open as well
state := "open"
_, _, err = issues.Edit(ctx, owner, repo, issue.GetNumber(), &github.IssueRequest{
_, _, err = issues.Edit(ctx, owner, issueRepo, issue.GetNumber(), &github.IssueRequest{
State: &state,
Body: &newBody,
})
Expand Down

0 comments on commit c26edb2

Please sign in to comment.