PyGithub / PyGithub/PyGithub

How can you retrieve the description of a pull request associated with a commit?

Open
#2,261 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.8k
Forks
1.9k
Avg merge
17m
Merged PRs (30d)
2

Description

I've tried the following;

commit = org.get_repo("my-repo").get_commit(sha="c2144da718afdbc343115e995f585d6d58c7ec6bd")
print(commit.author)
print(commit.committer)
print(commit.last_modified)

Which returns the details of the commit, however, can not find how to fetch the commit message.
I thought it might be;

print(commit.get_comments())

But that doesn't retrieve the commit message.

Does anyone know if it's possible?

thanks in advance!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names org.get_repo(...).get_commit(...) and commit.get_comments(), but no repository file or test. First clarify whether the desired value is the commit message or an associated pull request description, then inspect those API entry points; done requires a verified retrieval path for the requested value.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, python
Domain
api
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.