Skip to content

Commit 40d3394

Browse files
ericproulxclaude
authored andcommitted
Move Danger into its own Gemfile, loaded only by its workflow
Danger ran from the main Gemfile's :test group, which every gemfile in gemfiles/ evaluates. So each test job resolved and installed Danger's gems as well: 28 of the bundle's 90, Faraday, Octokit and kramdown among them. The `git < 6` pin (#3045) went to every bundle too. gemfiles/danger.gemfile now holds danger, danger-changelog, danger-pr-comment and the git pin, and nothing else, not even the gemspec. The main Gemfile drops them. numbata/danger-pr-comment's danger-run.yml can't pick a Gemfile, and a caller's env doesn't reach a reusable workflow. danger.yml therefore runs that workflow's steps itself, with BUNDLE_GEMFILE set on the job. The report artifact keeps the same names, so danger-comment.yml still posts the PR comment unchanged. The Dangerfile is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 0aa1fa5 commit 40d3394

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

‎.github/workflows/danger.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ on:
66

77
jobs:
88
danger:
9-
uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.1.0
9+
uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@main
1010
secrets: inherit
1111
with:
1212
ruby-version: '3.4'
13+
gemfile: gemfiles/danger.gemfile
1314
bundler-cache: true

‎Gemfile‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ group :development do
2121
end
2222

2323
group :test do
24-
gem 'danger', require: false
25-
gem 'danger-changelog', require: false
26-
gem 'danger-pr-comment', require: false
27-
# danger 9.6.1 fails to load with git 6: https://github.com/danger/danger/issues/1560
28-
gem 'git', '< 6', require: false
2924
gem 'rack-contrib', require: false
3025
gem 'rack-test', '~> 2.1'
3126
# ActiveSupport::XmlMini, Grape's XML backend without multi_xml, parses with

‎gemfiles/danger.gemfile‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# frozen_string_literal: true
2+
3+
# Danger's own bundle, used only by .github/workflows/danger.yml, so that its
4+
# gems stay out of the bundle every other Gemfile evaluates. To run it locally:
5+
#
6+
# BUNDLE_GEMFILE=gemfiles/danger.gemfile bundle exec danger local
7+
8+
source 'https://rubygems.org'
9+
10+
gem 'danger'
11+
gem 'danger-changelog'
12+
gem 'danger-pr-comment'
13+
# danger 9.6.1 fails to load with git 6: https://github.com/danger/danger/issues/1560
14+
gem 'git', '< 6'

0 commit comments

Comments
 (0)