So far as I understand it, messages are associated with commits. But when you look at a repo on GitHub it helpfully lists the message by each file, for when it was last changed.
I'm listing commits on the repository and than grabbing the first one and reading it's SHA and it works great:
https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository
In Go it looks something like this:
func GetLatestCommit(owner, repo string, sgc *github.Client) (string, error) {
commits, res, err := sgc.Repositories.ListCommits(owner, repo, &github.CommitsListOptions{})
if err != nil {
log.Printf("err: %s res: %s", err, res)
return "", err
}
log.Printf("last commit: %s", *commits[0].SHA)
return *commits[0].SHA, nil
}