PyGithub / PyGithub/PyGithub

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

未關閉
#2,261 6 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
Python
星號
7.8k
分支
1.9k
平均合併
17 分鐘
30 天內合併 PR
2

描述

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!

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

該 issue 提到了 org.get_repo(...).get_commit(...) 和 commit.get_comments(),但沒有提供任何 repository 檔案或測試。首先釐清所需值是 commit message 還是相關 pull request 的描述,然後檢查這些 API 進入點;只有為所要求的值驗證出一條擷取路徑後,才算完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
github, python
領域
api
Issue 類型
文件
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。