diff --git a/.gitignore b/.gitignore index ec0b196..1b1cf0b 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,5 @@ # Ignore master key for decrypting credentials and more. /config/master.key + +/config/application.yml diff --git a/Gemfile b/Gemfile index c025b17..66cc55c 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,8 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.4.1' +gem 'figaro' + # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.0' # Use sqlite3 as the database for Active Record diff --git a/Gemfile.lock b/Gemfile.lock index f893f8a..af23ba1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -76,6 +76,8 @@ GEM erubi (1.7.1) execjs (2.7.0) ffi (1.9.25) + figaro (1.1.1) + thor (~> 0.14) globalid (0.4.1) activesupport (>= 4.2.0) i18n (1.0.1) @@ -197,6 +199,7 @@ DEPENDENCIES capybara (>= 2.15, < 4.0) chromedriver-helper coffee-rails (~> 4.2) + figaro jbuilder (~> 2.5) listen (>= 3.0.5, < 3.2) puma (~> 3.11) diff --git a/lib/tasks/repositories.rake b/lib/tasks/repositories.rake index b0a1c8c..47e3c44 100644 --- a/lib/tasks/repositories.rake +++ b/lib/tasks/repositories.rake @@ -16,13 +16,15 @@ namespace :repositories do desc 'Update version from github repositories' task github: :environment do + headers = { + 'Accept' => 'application/vnd.github.v3+json' + } + headers['Authorization'] = "token #{Figaro.env.github_token}" if Figaro.env.github_token + GithubRepository.all.each do |repo| begin software = Software.find(repo.software_id) versions = software.versions.all.map(&:number) - headers = { - 'Accept' => 'application/vnd.github.v3+json' - } tags = JSON.parse( get_url_content(