Open petrosh opened 8 years ago
Use file
path
: file url relative to script.
curl "https://api.github.com/repos/parliamone/paliamone.github.io/commits?path=README.md&sha=gh-pages"
[
{
"sha": "062c108486f9feb3a24212e7fb2d521e8add12f8",
"commit": {
"author": {
"date": "2016-0824T09:50:13Z"
},
"message": "Initial commit",
"comment_count": 0
},
"author": {
"login": "petrosh",
"avatar_url": "https://avatars.githubusercontent.com/u/4997583?v=3",
"type": "User"
},
"parents": [
]
}
]
Use label
get commits and comment count for a path
GET /repos/:owner/:repo/commits?path=:path&sha=:branch
sha
commit SHA used for linkcommit.message
post titlecommit.comment_count
post comments (min 1)commit.author.date
date of postauthor.login
OP usernameauthor.avatar_url
OP avatar url get comments for a commit
GET /repos/:owner/:repo/commits/:ref/comments
Accept: application/vnd.github.squirrel-girl-preview
include reactions
payload
"reactions": {
"url": "https://api.github.com/repos/gabrielecirulli/2048/comments/7690815/reactions",
"total_count": 0,
"+1": 0,
"-1": 0,
"laugh": 0,
"hooray": 0,
"confused": 0,
"heart": 0
}
id
comment IDbody
comment bodyuser.login
commenteruser.avatar_url
commenter avatar urlcreated_at
creation timeupdated_at
edit time (or identical to created_at
)user.site_admin
if poster is adminposition
, line
, path
nulls if not a code notereactions.total_count
total reactions application/vnd.github-commitcomment.raw+json
application/vnd.github-commitcomment.text+json
application/vnd.github-commitcomment.html+json
application/vnd.github-commitcomment.full+json
GET /repos/:owner/:repo/
GET /repos/:owner/:repo/commits?per_page=1&until=:created_at
GET /repos/:owner/:repo/commits?per_page=1&path=/dir/file.ext
GET /repos/:owner/:repo/git/trees/:sha?recursive=1
{
"sha": "fc6274d15fa3ae2ab983129fb037999f264ba9a7",
"url": "https://api.github.com/repos/octocat/Hello-World/trees/...",
"tree": [
{
"path": "subdir/file.txt",
"mode": "100644",
"type": "blob",
"size": 132,
"sha": "7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b",
"url": "https://api.github.com/repos/octocat/Hello-World/git/..."
}
],
"truncated": false
}
GET /repos/:owner/:repo/commits
sha
– SHA or branch to start listing commits from. Default: the repository’s default branch (usually master).path
– Only commits containing this file path will be returned.author
– GitHub login or email address by which to filter by commit author.since
or until
– Only commits after or before this date will be returned. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ[
{
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"commit": {
"message": "Fix all the bugs",
"comment_count": 0
}
}
]
GET /repos/:owner/:repo/comments
Ordered by ascending ID.
[
{
"body": "...",
"user": {
"login": "..."
},
"created_at": "...",
"path": "file1.txt",
"position": 4,
"line": 14
}
]
GET /repos/:owner/:repo/commits/:ref/comments
POST /repos/:owner/:repo/commits/:sha/comments
body
– Required. The contents of the comment.path
– Relative path of the file to comment on.position
– Line index in the diff to comment on.
The reactions
key will have the following payload.
{
"total_count": 5,
"+1": 3,
"-1": 1,
"laugh": 0,
"confused": 0,
"heart": 1,
"hooray": 0,
"url": "https://api.github.com/repos/octocat/Hello-World/comments/1/reactions"
}
$ curl "https://api.github.com/repos/jquery/jquery/issues/3080/reactions" -H "Accept: application/vnd.github.squirrel-girl-preview"
get reactions for every comment
GET /repos/:owner/:repo/commits/:ref/comments
user.login
reactercontent
reactioncreated_at
time of reactionTo access the API you must provide a custom media type in the Accept
header: application/vnd.github.squirrel-girl-preview