mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 21:00:03 +08:00
fix(github api): fix authentication
This commit is contained in:
parent
d518040658
commit
b30894369c
@ -366,6 +366,27 @@ EOT
|
|||||||
rm -rf detach/$1
|
rm -rf detach/$1
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
github.vim)
|
||||||
|
git clone https://github.com/wsdjeg/GitHub.vim.git detach/$1
|
||||||
|
cd detach/$1
|
||||||
|
_checkdir plugin/
|
||||||
|
_checkdir autoload/
|
||||||
|
_detact LICENSE
|
||||||
|
_detact_bundle github.vim autoload/github.vim
|
||||||
|
_detact_bundle github.vim plugin/github.vim
|
||||||
|
_default_readme "GitHub.vim" "GitHub API support for neovim/vim[wip]"
|
||||||
|
_checkdir doc/
|
||||||
|
_detact_bundle github doc/github.txt
|
||||||
|
git add .
|
||||||
|
git config user.email "wsdjeg@qq.com"
|
||||||
|
git config user.name "SpaceVimBot"
|
||||||
|
git commit -m "Auto Update based on https://github.com/SpaceVim/SpaceVim/commit/${GITHUB_SHA}"
|
||||||
|
git remote add wsdjeg_github_vim https://SpaceVimBot:${BOTSECRET}@github.com/wsdjeg/GitHub.vim.git
|
||||||
|
git push wsdjeg_github_vim master
|
||||||
|
cd -
|
||||||
|
rm -rf detach/$1
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
spacevim-theme)
|
spacevim-theme)
|
||||||
exit 0
|
exit 0
|
||||||
esac
|
esac
|
||||||
|
2
.github/workflows/async.yml
vendored
2
.github/workflows/async.yml
vendored
@ -7,7 +7,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
detachPlugin: ["flygrep", "dein-ui", "vim-todo", "iedit", "scrollbar.vim", "vim-chat", "vim-cheat", "xmake.vim"]
|
detachPlugin: ["flygrep", "dein-ui", "vim-todo", "iedit", "scrollbar.vim", "vim-chat", "vim-cheat", "xmake.vim", "github.vim"]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
7
bundle/github.vim/autoload/github/api.vim
vendored
7
bundle/github.vim/autoload/github/api.vim
vendored
@ -0,0 +1,7 @@
|
|||||||
|
function! github#api#authorize() abort
|
||||||
|
if !empty(g:githubapi_token)
|
||||||
|
return ['--header', "Authorization: Bearer " . g:githubapi_token]
|
||||||
|
else
|
||||||
|
return []
|
||||||
|
endif
|
||||||
|
endfunction
|
11
bundle/github.vim/autoload/github/api/issues.vim
vendored
11
bundle/github.vim/autoload/github/api/issues.vim
vendored
@ -107,11 +107,18 @@ endfunction
|
|||||||
" <
|
" <
|
||||||
" Github API : POST /repos/:owner/:repo/issues
|
" Github API : POST /repos/:owner/:repo/issues
|
||||||
function! github#api#issues#Create(owner,repo,user,password,issue) abort
|
function! github#api#issues#Create(owner,repo,user,password,issue) abort
|
||||||
|
if empty(a:password) || empty(a:user)
|
||||||
return github#api#util#Get('repos/' . a:owner . '/' . a:repo . '/issues',
|
return github#api#util#Get('repos/' . a:owner . '/' . a:repo . '/issues',
|
||||||
\ ['-X', 'POST', '-d', json_encode(a:issue),
|
\ ['-X', 'POST', '-d', json_encode(a:issue)
|
||||||
\ '-u', a:user . ':' . a:password])
|
\ ] + github#api#authorize())
|
||||||
|
else
|
||||||
|
return github#api#util#Get('repos/' . a:owner . '/' . a:repo . '/issues',
|
||||||
|
\ ['-X', 'POST', '-d', json_encode(a:issue),
|
||||||
|
\ '-u', a:user . ':' . a:password])
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
""
|
""
|
||||||
" Edit an issue
|
" Edit an issue
|
||||||
" PATCH /repos/:owner/:repo/issues/:number
|
" PATCH /repos/:owner/:repo/issues/:number
|
||||||
|
2
bundle/github.vim/plugin/github.vim
vendored
2
bundle/github.vim/plugin/github.vim
vendored
@ -13,6 +13,8 @@ let g:githubapi_root_url = 'https://api.github.com/'
|
|||||||
""
|
""
|
||||||
" set githubapi verbose when run shell command. By default it is 0.
|
" set githubapi verbose when run shell command. By default it is 0.
|
||||||
let g:githubapi_verbose = get(g:, 'githubapi_verbose', 0)
|
let g:githubapi_verbose = get(g:, 'githubapi_verbose', 0)
|
||||||
|
|
||||||
|
let g:githubapi_token = ''
|
||||||
""
|
""
|
||||||
" Specific the path for curl, by default it is 'curl', in windows you can use
|
" Specific the path for curl, by default it is 'curl', in windows you can use
|
||||||
" >
|
" >
|
||||||
|
Loading…
Reference in New Issue
Block a user