This repository was archived by the owner on Dec 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +13
-22
lines changed
Expand file tree Collapse file tree 5 files changed +13
-22
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,6 @@ jobs:
117117 }
118118
119119 // Fail if there are errors
120- if (report.errors && report.errors.length > 0 ) {
120+ if (hasItems( report.errors) ) {
121121 core.setFailed('Danger found errors');
122122 }
Original file line number Diff line number Diff line change 33### 0.2.2 (Next)
44
55* Your contribution here.
6+ * [ #16 ] ( https://github.com/ruby-grape/danger/pull/16 ) : Report workflow postreview fixes - [ @numbata ] ( https://github.com/numbata ) .
67* [ #15 ] ( https://github.com/ruby-grape/danger/pull/15 ) : Extract danger reporting infrastructure into reusable workflows and gem - [ @numbata ] ( https://github.com/numbata ) .
78
89### 0.2.1 (2024/02/01)
Original file line number Diff line number Diff line change @@ -8,19 +8,17 @@ require 'English'
88# to get automatic reporting with their own custom checks.
99
1010# Register at_exit hook to export report when Dangerfile finishes
11+ dangerfile_instance = self if defined? ( Danger ::Dangerfile ) && is_a? ( Danger ::Dangerfile )
1112at_exit do
1213 # Only skip if there's an actual exception (not SystemExit from danger calling exit)
1314 next if $ERROR_INFO && !$ERROR_INFO. is_a? ( SystemExit )
15+ next unless dangerfile_instance
1416
15- # Find the Dangerfile instance and get its current status_report
16- ObjectSpace . each_object ( Danger ::Dangerfile ) do |df |
17- reporter = RubyGrapeDanger ::Reporter . new ( df . status_report )
18- reporter . export_json (
19- ENV . fetch ( 'DANGER_REPORT_PATH' , nil ) ,
20- ENV . fetch ( 'GITHUB_EVENT_PATH' , nil )
21- )
22- break
23- end
17+ reporter = RubyGrapeDanger ::Reporter . new ( dangerfile_instance . status_report )
18+ reporter . export_json (
19+ ENV . fetch ( 'DANGER_REPORT_PATH' , nil ) ,
20+ ENV . fetch ( 'GITHUB_EVENT_PATH' , nil )
21+ )
2422end
2523
2624# --------------------------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change 1313 - [ Commit via a Pull Request] ( #commit-via-a-pull-request )
1414- [ Reusable Workflows] ( #reusable-workflows )
1515 - [ Architecture] ( #architecture )
16- - [ Benefits of Reusable Workflows] ( #benefits-of-reusable-workflows )
1716 - [ How It Works] ( #how-it-works )
1817 - [ Examples] ( #examples )
1918- [ License] ( #license )
6059
6160jobs :
6261 danger :
63- uses : ruby-grape/ruby-grape- danger/.github/workflows/danger-run.yml@main
62+ uses : ruby-grape/danger/.github/workflows/danger-run.yml@main
6463` ` `
6564
6665Create ` .github/workflows/danger-comment.yml`:
7574
7675jobs:
7776 comment:
78- uses: ruby-grape/ruby-grape- danger/.github/workflows/danger-comment.yml@main
77+ uses: ruby-grape/danger/.github/workflows/danger-comment.yml@main
7978` ` `
8079
8180# ## Commit via a Pull Request
@@ -100,19 +99,12 @@ The workflows are separated into two stages:
10099 - Formats and posts results as a PR comment
101100 - Updates existing comment on subsequent runs
102101
103- # ## Benefits of Reusable Workflows
104-
105- ✅ **DRY** : Define workflows once in `ruby-grape-danger`, reuse everywhere
106- ✅ **Consistent** : All Grape projects use the same reporting format and behavior
107- ✅ **Maintainable** : Fix a bug in the workflows once, all projects benefit automatically
108- ✅ **Scalable** : Add new checks to any project's Dangerfile without touching workflows
109-
110102# ## How It Works
111103
112104When you reference the reusable workflows :
113105
114106` ` ` yaml
115- uses: ruby-grape/ruby-grape- danger/.github/workflows/danger-run.yml@main
107+ uses: ruby-grape/danger/.github/workflows/danger-run.yml@main
116108` ` `
117109
118110GitHub Actions :
Original file line number Diff line number Diff line change @@ -18,6 +18,6 @@ Gem::Specification.new do |s|
1818 s . add_development_dependency 'rake'
1919 s . add_development_dependency 'rspec'
2020 s . add_runtime_dependency 'danger' , '~> 9'
21- s . add_runtime_dependency 'danger-changelog' , '~> 0.7 '
21+ s . add_runtime_dependency 'danger-changelog' , '~> 0.8 '
2222 s . add_runtime_dependency 'danger-toc' , '~> 0.2'
2323end
You can’t perform that action at this time.
0 commit comments