Skip to content

Commit

Permalink
Add func for get latest release
Browse files Browse the repository at this point in the history
  • Loading branch information
wsdjeg committed Nov 5, 2017
1 parent 5aa894d commit a62d759
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 179 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
libs/GitHub-api/target
build/
tags
26 changes: 25 additions & 1 deletion autoload/github/api/repos/releases.vim
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,33 @@
" "prerelease": false
" }
" <
" Github API : POST /repos/:owner/:repo/releases
" Github API: POST /repos/:owner/:repo/releases
function! github#api#repos#releases#Create(owner,repo,user,password, release) abort
return github#api#util#Get('repos/' . a:owner . '/' . a:repo . '/releases',
\ ['-X', 'POST', '-d', json_encode(a:release),
\ '-u', a:user . ':' . a:password])
endfunction


""
" @public
" Get the latest release
"
" Github API: GET /repos/:owner/:repo/releases/latest
function! github#api#repos#releases#latest(owner, repo)
return github#api#util#Get('repos/' . a:owner . '/' . a:repo . '/releases/latest')
endfunction


" TODO Get a single release
" TODO Get a release by tag name
" TODO Edit a release
" TODO Delete a release
" TODO List assets for a release
" TODO Upload a release asset
" TODO List releases for a repository
" TODO Get a single release asset
" TODO Edit a release asset
" TODO Delete a release asset


8 changes: 7 additions & 1 deletion doc/github.txt
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,13 @@ github#api#repos#releases#Create({owner}, {repo}, {user}, {password},
<
{ "tag_name": "v1.0.0", "target_commitish": "master", "name": "v1.0.0",
"body": "Description of the release", "draft": false, "prerelease": false
} < Github API : POST /repos/:owner/:repo/releases
} < Github API: POST /repos/:owner/:repo/releases

github#api#repos#releases#latest({owner}, {repo})
*github#api#repos#releases#latest()*
Get the latest release

Github API: GET /repos/:owner/:repo/releases/latest

github#api#search#SearchRepos({q}, {sort}, {order})
*github#api#search#SearchRepos()*
Expand Down
Loading

0 comments on commit a62d759

Please sign in to comment.