Skip to content

Commit 8d9ed57

Browse files
dblockclaude
andcommitted
Migrate Danger to use danger-pr-comment workflow.
Replaces manual Danger setup with reusable workflow from numbata/danger-pr-comment, following the pattern from slack-ruby/slack-ruby-client#581 and slack-ruby/slack-ruby-bot-server#181. - Add danger, danger-pr-comment, danger-changelog, and danger-toc to Gemfile - Update Dangerfile to import danger-pr-comment and add changelog.check! and toc.check! - Replace danger.yml workflow with reusable workflow pattern - Add danger-comment.yml workflow for PR comments 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ac9b723 commit 8d9ed57

File tree

5 files changed

+33
-21
lines changed

5 files changed

+33
-21
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Danger Comment
2+
3+
on:
4+
workflow_run:
5+
workflows: [Danger]
6+
types: [completed]
7+
8+
jobs:
9+
comment:
10+
uses: numbata/danger-pr-comment/.github/workflows/danger-comment.yml@main
11+
secrets: inherit

.github/workflows/danger.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
1-
---
2-
name: danger
3-
on: pull_request
1+
name: Danger
2+
on:
3+
pull_request:
4+
types: [opened, reopened, edited, synchronize]
45

56
jobs:
67
danger:
7-
runs-on: ubuntu-latest
8-
steps:
9-
- uses: actions/checkout@v6
10-
with:
11-
fetch-depth: 100
12-
- name: Set up Ruby
13-
uses: ruby/setup-ruby@v1
14-
with:
15-
ruby-version: 3.4
16-
bundler-cache: true
17-
- name: Run Danger
18-
run: |
19-
# the token is public, has public_repo scope and belongs to the grape-bot user owned by @dblock, this is ok
20-
TOKEN=$(echo -n Z2hwX2lYb0dPNXNyejYzOFJyaTV3QUxUdkNiS1dtblFwZTFuRXpmMwo= | base64 --decode)
21-
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose
22-
8+
uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@main
9+
secrets: inherit
10+
with:
11+
ruby-version: "3.4"

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### Next
2+
3+
#### Features
4+
5+
* [#970](https://github.com/ruby-grape/grape-swagger/pull/970): Migrate Danger to use danger-pr-comment workflow - [@dblock](https://github.com/dblock).
6+
17
### 2.1.3 (2025-11-21)
28

39
#### Features

Dangerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# frozen_string_literal: true
22

3-
danger.import_dangerfile(gem: 'ruby-grape-danger')
3+
danger.import_dangerfile(gem: 'danger-pr-comment')
4+
5+
changelog.check!
6+
toc.check!

Gemfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ group :development, :test do
4545
end
4646

4747
group :test do
48-
gem 'ruby-grape-danger', '~> 0.2', require: false
48+
gem 'danger', require: false
49+
gem 'danger-changelog', require: false
50+
gem 'danger-pr-comment', require: false
51+
gem 'danger-toc', require: false
4952
gem 'simplecov', require: false
5053
gem 'super_diff', require: false
5154
end

0 commit comments

Comments
 (0)