pronto: Rugged 1.7.1 breaks gem
Rugged update 1.7.1 which came out yesterday breaks the gem.
I’m using it in a github action.
/lib/rugged/repository.rb:114:in `diff': undefined method `[]' for nil:NilClass (NoMethodError)
right.diff(left, opts.merge(:reverse => !opts[:reverse]))
^^^^^^^^^^
from /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/pronto-0.11.1/lib/pronto/git/repository.rb:30:in `diff'
from /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/pronto-0.11.1/lib/pronto.rb:64:in `run'
from /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/pronto-0.11.1/lib/pronto/cli.rb:70:in `block in run'
from /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/pronto-0.11.1/lib/pronto/cli.rb:6[8]:in `chdir'
from /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/pronto-0.11.1/lib/pronto/cli.rb:68:in `run'
from /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
from /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
from /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor.rb:3[9]2:in `dispatch'
from /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor/base.rb:485:in `start'
from /opt/hostedtoolcache/Ruby/3.1.4/x64/lib/ruby/gems/3.1.0/gems/pronto-0.[11].1/bin/pronto:6:in `<top (required)>'
from /opt/hostedtoolcache/Ruby/3.1.4/x64/bin/pronto:25:in `load'
from /opt/hostedtoolcache/Ruby/3.1.4/x64/bin/pronto:25:in `<main>'
Github action workflow:
---
name: Pronto
on: [pull_request]
jobs:
pronto:
if: ${{ !contains(github.actor, '[bot]') }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- run: |
git fetch --no-tags --prune --depth=50 origin +refs/heads/*:refs/remotes/origin/*
- name: Setup Ruby
uses: ruby/setup-ruby@v1
- name: Setup pronto
run: gem install rubocop-rails pronto pronto-rubocop
- name: Run Pronto
run: >
PRONTO_PULL_REQUEST_ID="${{ github.event.pull_request.number }}"
PRONTO_GITHUB_ACCESS_TOKEN="${{ github.token }}"
pronto run -f github_status text -c origin/${{ github.base_ref }}
Fixed by pinning rugged to 1.6.3. Action runs with ruby 3.1.4 which is specified in our .ruby-version.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 9
- Comments: 21 (10 by maintainers)
Commits related to this issue
- Pin rugged to below 1.7 Fixes https://github.com/prontolabs/pronto/issues/447 — committed to magni-/pronto by magni- 3 years ago
- Fix Shallow Checkouts This addresses Issue #447 — committed to X-sam/pronto by X-sam 3 years ago
- Bump pronto-rubocop from 0.11.5 to 0.11.6 Bumps [pronto-rubocop](https://github.com/mmozuras/pronto-rubocop) from 0.11.5 to 0.11.6. - [Release notes](https://github.com/mmozuras/pronto-rubocop/relea... — committed to consuldemocracy/consuldemocracy by taitus 2 years ago
If you’re here because you’re seeing a Github Action failing with this error, you can pin your version of rugged to 1.6.3 by updating the Github Actions Integration example code as follows:
@jeantristan see this comment from the PR author @X-sam – it seems to be a bug in rugged itself.
Is there any reason not to make this one line change? As someone who’s impacted by this, it would be nice to be able to use Pronto alongside a less deep checkout.
No error with this version of the checkout step.