Use access tokens

This commit is contained in:
Wedge 2020-11-15 03:07:03 +03:00
parent 40536d4d4d
commit 1a8691ad2f
1 changed files with 3 additions and 4 deletions

View File

@ -1,14 +1,13 @@
#configuration of Github api gem #configuration of Github api gem
Github_blobs_api = Octokit::Client.new(login: ENV['GITHUB_REPO_BOT_LOGIN'], password: ENV['GITHUB_REPO_BOT_PASSWORD']) Github_blobs_api = Octokit::Client.new(access_token: ENV["GITHUB_REPO_BOT_ACCESS_TOKEN"])
Octokit.configure do |c| Octokit.configure do |c|
c.login = ENV["GITHUB_LOGIN"] c.access_token = ENV["GITHUB_ACCESS_TOKEN"]
c.password = ENV["GITHUB_PASSWORD"]
end end
Octokit.middleware = Faraday::RackBuilder.new do |builder| Octokit.middleware = Faraday::RackBuilder.new do |builder|
store = ActiveSupport::Cache.lookup_store(:redis_store, ENV['REDIS_URL'].to_s + '/1') store = ActiveSupport::Cache.lookup_store(:redis_store, ENV['REDIS_URL'].to_s + '/1')
builder.use Faraday::HttpCache, store: store, shared_cache: false, serializer: Marshal builder.use Faraday::HttpCache, store: store, shared_cache: false, serializer: Marshal
builder.use Octokit::Response::RaiseError builder.use Octokit::Response::RaiseError
builder.adapter Faraday.default_adapter builder.adapter Faraday.default_adapter
end end