Open ghost opened 10 years ago
This worked:
sha = Github.repos.contents.get(path: '/data/plugin_vulns.xml')[:sha]
Github.repos.contents.update 'wpvulndb', 'wpscan', '/data/plugin_vulns.xml', path: '/data/plugin_vulns.xml', message: 'Update commit from WPVULNDB', content: Typhoeus.get('/api/v1/export_plugins/').body, sha: sha
It seems that the sha
argument also needs passing but this is not mentioned in the error. Also, for some reason I had to pass the user, repo and path to update even though I had configured them previously (other configs such as basic_auth worked).
Thanks for your report!
Regarding the user, repo parameters, I had some problems getting the logic right in the past. Since then it has been rewritten and I should be in position to release it soon. The configuration options are global in a sense and it is much better to pass these per method call anyway.
Not sure why the :sha
parameter has been excluded from the error message, I trust it should be fixed in new argument parser. I will add that to the test suite.
Unrelated:
To use the Typhoeus adapter you need to include the Typhoeus faraday code, example:
Github.configure do |config|
require 'typhoeus/adapters/faraday'
config.basic_auth = "wpvulndb:#{password}"
config.user = 'wpvulndb'
config.repo = 'wpscan'
config.adapter = :typhoeus
end
Otherwise you get this error:
undefined method `ssl_cacert=' for #<Typhoeus::Request:0x007fa771cea278>
Not sure if it is worth putting in the readme or not.
I will keep this one open as I certainly want to rewrite the documentation to be more comprehensive and include gotchas like this! Thanks