diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 564bc2c..7859e1d 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -1,22 +1,24 @@ name: Ruby -on: [push] +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] jobs: test: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.4', '2.5', '2.6'] + ruby-version: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', 'truffleruby-head'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Ruby ${{ matrix.ruby-version }} - uses: actions/setup-ruby@v1 + uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true - name: Build and test with Rake - run: | - gem install bundler - bundle install --jobs 4 --retry 3 - bundle exec rake + run: bundle exec rake diff --git a/README.md b/README.md index ce4ad43..d621158 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ This is the official OmniAuth strategy for authenticating to GitHub. To use it, you'll need to sign up for an OAuth2 Application ID and Secret -on the [GitHub Applications Page](https://github.com/settings/applications). +on the [GitHub OAuth Apps Page](https://github.com/settings/developers). ## Installation ```ruby -gem 'omniauth-github', github: 'omniauth/omniauth-github', branch: 'master' +gem 'omniauth-github', '~> 2.0.0' ``` ## Basic Usage @@ -20,6 +20,18 @@ use OmniAuth::Builder do end ``` + +## Basic Usage Rails + +In `config/initializers/github.rb` + +```ruby + Rails.application.config.middleware.use OmniAuth::Builder do + provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET'] + end +``` + + ## Github Enterprise Usage ```ruby @@ -43,7 +55,7 @@ use OmniAuth::Builder do end ``` -More info on [Scopes](http://developer.github.com/v3/oauth/#scopes). +More info on [Scopes](https://docs.github.com/en/developers/apps/scopes-for-oauth-apps). ## Semver diff --git a/lib/omniauth-github/version.rb b/lib/omniauth-github/version.rb index 76cc466..aa3add2 100644 --- a/lib/omniauth-github/version.rb +++ b/lib/omniauth-github/version.rb @@ -1,5 +1,5 @@ module OmniAuth module GitHub - VERSION = "1.4.0" + VERSION = "2.0.1" end end diff --git a/lib/omniauth/strategies/github.rb b/lib/omniauth/strategies/github.rb index 7ac5a15..8146d6c 100644 --- a/lib/omniauth/strategies/github.rb +++ b/lib/omniauth/strategies/github.rb @@ -75,7 +75,7 @@ def email_access_allowed? end def callback_url - full_host + script_name + callback_path + full_host + callback_path end end end diff --git a/omniauth-github.gemspec b/omniauth-github.gemspec index 675f8ff..507868d 100644 --- a/omniauth-github.gemspec +++ b/omniauth-github.gemspec @@ -16,8 +16,8 @@ Gem::Specification.new do |gem| gem.require_paths = ["lib"] gem.version = OmniAuth::GitHub::VERSION - gem.add_dependency 'omniauth', '~> 1.5' - gem.add_dependency 'omniauth-oauth2', '>= 1.4.0', '< 2.0' + gem.add_dependency 'omniauth', '~> 2.0' + gem.add_dependency 'omniauth-oauth2', '~> 1.8' gem.add_development_dependency 'rspec', '~> 3.5' gem.add_development_dependency 'rack-test' gem.add_development_dependency 'simplecov'