hexo-deployer-git icon indicating copy to clipboard operation
hexo-deployer-git copied to clipboard

Added personal token in _config.yml but still can't access git

Open masterrite opened this issue 4 years ago • 3 comments

I'm using the latest version of hexo-deployer-git but I can't access my repo. Here's the error:

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: unable to access 'https://github.com/*****.github.io/': The requested URL returned error: 403
FATAL { err:
   { Error: Spawn failed
       at ChildProcess.<anonymous> (F:\Hexo\node_modules\hexo-util\lib\spawn.js:52:19)
       at ChildProcess.emit (events.js:198:13)
       at ChildProcess.cp.emit (F:\Hexo\node_modules\cross-spawn\lib\enoent.js:40:29)
       at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) code: 128 } } 'Something\'s wrong. Maybe you can find the solution here: %s' 'https://hexo.io/docs/troubleshooting.html'

Here's the _config.yaml for deployer:

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repository: https://github.com/*****.github.io
  branch: master
  token: ghp_*****

masterrite avatar Aug 18 '21 18:08 masterrite

+1

yangxyo avatar Aug 22 '21 03:08 yangxyo

Figured it out thanks to @zcsheng95: https://github.com/hexojs/hexo/issues/4757#issuecomment-901613964.

However, this isn't is fix from hexo-deployer-git's side. It'd be nice to update the plugin.

masterrite avatar Aug 22 '21 19:08 masterrite

https://github.com/hexojs/hexo/issues/4757#issuecomment-901613964 is right , you need add your username to the url, like this https://oauth2:ghp_********@github.com/yourusername/yourusername.github.io, it's work for me

jos-app avatar Sep 08 '21 09:09 jos-app