Skip to content

danger is not working with bundler@2.5.1 #1472

Description

@okatatuki

Report

danger is not working with bundler@2.5.1

What did you do?

I run danger at github actions "danger/danger@master"

What did you expect to happen?

successful termination

my Dangerfile only follow correcting branch name

What happened instead?

error happend

  #11 [7/8] RUN gem install bundler
  #11 22.54 ERROR:  Error installing bundler:
  #11 22.54 	The last version of bundler (>= 0) to support your Ruby & RubyGems was 2.4.22. Try installing it with `gem install bundler -v 2.4.22`
  #11 22.54 	bundler requires Ruby version >= 3.0.0. The current ruby version is 2.7.8.225.
  #11 ERROR: process "/bin/sh -c gem install bundler" did not complete successfully: exit code: 1
  ------
   > [7/8] RUN gem install bundler:
  22.54 ERROR:  Error installing bundler:
  22.54 	The last version of bundler (>= 0) to support your Ruby & RubyGems was 2.4.22. Try installing it with `gem install bundler -v 2.4.22`
  22.54 	bundler requires Ruby version >= 3.0.0. The current ruby version is 2.7.8.225.
  ------
  Dockerfile:21
  --------------------
    19 |     COPY . /myapp
    20 |     
    21 | >>> RUN gem install bundler
    22 |     
    23 |     ENV BUNDLE_GEMFILE=/myapp/Gemfile
  --------------------
  ERROR: failed to solve: process "/bin/sh -c gem install bundler" did not complete successfully: exit code: 1
Error: Docker build failed with exit code 1

I suggensting ruby version discrepancies

danger run ruby@2.7

FROM ruby:2.7

danger use bundler@latest

gem "bundler"

but bundler require ruby version 3.0.0
https://rubygems.org/gems/bundler/versions/2.5.1

Your Environment

  • github actions
name: check pull request

on: pull_request

jobs:
  danger:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: danger/danger@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  • What is your Dangerfile?
base_branch = github.branch_for_base
head_branch = github.branch_for_head

if base_branch.match(/release\/.+/) && !head_branch.match(/feature\/.+/)
    fail('release/** ブランチに merge するのは feature/** ブランチにしてください')
end

if base_branch == 'main' && !(head_branch.match(/release\/.+/) || head_branch.match(/hotfix\/.+/) || head_branch.match(/feature\/.+/))
    fail('main ブランチに merge するのは release/**  または hotfix/** または feature/** ブランチにしてください')
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions