func()

in pkg/event_processor/github/github.go [212:235]


func (*EventProcessor) getCommitMessage(
	ctx context.Context,
	client *github.Client,
	owner string,
	repo string,
	number int,
) (string, error) {
	commits, _, err := client.PullRequests.ListCommits(ctx, owner, repo, number, nil)
	if err != nil {
		return "", fmt.Errorf("failed to get GitHub pull request commits: %w", err)
	}

	if len(commits) == 0 {
		return "", errors.New("github pull request commits empty")
	}

	m := commits[len(commits)-1].Commit.Message

	if m == nil {
		return "", nil
	}

	return *m, nil
}