GitHub Events APIを介してこの情報にアクセスできるはずです。
- 構文:
GET /repos/:owner/:repo/events
- 例:
https://api.github.com/users/libgit2/events
これにより、イベントの JSON 配列が返されます。誰がこのリポジトリにプッシュしたかを発見するには、それらのイベントをフィルタリングし、type
プロパティが等しいイベントのみを調べる必要があります"WatchEvent"
。actor
プロパティには、プッシャーに関する詳細が含まれます。
そのようなサンプルの下にPushEvent
{
id:"1842109394",
type:"PushEvent",
actor:{
id:39902,
login:"ben",
gravatar_id:"0d410939c9e80980cf0430772567dfb4",
url:"https://api.github.com/users/ben",
avatar_url:"https://2.gravatar.com/avatar/0d410939c9e80980cf0430772567dfb4?d=https%3A%2F%2Fa248.e.akamai.net%2Fassets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
},
repo:{
id:901662,
name:"libgit2/libgit2",
url:"https://api.github.com/repos/libgit2/libgit2"
},
payload:{
push_id:235346159,
size:1,
distinct_size:1,
ref:"refs/heads/redir-refactor",
head:"b59344bf83049a5639c32ab52efceea2eec9484b",
before:"256961e45d574ace62a7a7d13b697aa05e8a9466",
commits:[
{
sha:"b59344bf83049a5639c32ab52efceea2eec9484b",
author:{
email:"bs@github.com",
name:"Ben Straub"
},
message:"Tighten up url-connection utility",
distinct:true,
url:"https://api.github.com/repos/libgit2/libgit2/commits/b59344bf83049a5639c32ab52efceea2eec9484b"
}
]
},
public:true,
created_at:"2013-09-26T23:56:59Z",
org:{
id:394745,
login:"libgit2",
gravatar_id:"1c56acccc41c591705dc92da5f6ab603",
url:"https://api.github.com/orgs/libgit2",
avatar_url:"https://1.gravatar.com/avatar/1c56acccc41c591705dc92da5f6ab603?d=https%3A%2F%2Fa248.e.akamai.net%2Fassets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png"
}
}