Skip to content

Commit 72b8cf0

Browse files
dblockclaude
andcommitted
Migrate Danger to use danger-pr-comment workflow.
- Migrated from custom Danger setup to danger-pr-comment workflow framework - Replaced manual Danger workflow with reusable workflows from numbata/danger-pr-comment - Added .github/workflows/danger.yml using danger-pr-comment reusable workflow - Added .github/workflows/danger-comment.yml for posting PR comments - Updated Gemfile to include danger, danger-pr-comment, danger-changelog, and danger-toc - Updated Dangerfile to import danger-pr-comment and added changelog.check! and toc.check! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent ebe5476 commit 72b8cf0

File tree

4 files changed

+29
-18
lines changed

4 files changed

+29
-18
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/[email protected]
11+
secrets: inherit

.github/workflows/danger.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1-
---
2-
name: danger
3-
on: pull_request
1+
name: Danger
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, edited, synchronize]
46

57
jobs:
68
danger:
7-
runs-on: ubuntu-latest
8-
steps:
9-
- uses: actions/checkout@v4
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
9+
uses: numbata/danger-pr-comment/.github/workflows/[email protected]
10+
secrets: inherit
11+
with:
12+
ruby-version: '3.4'
13+
bundler-cache: true

Dangerfile

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

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

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ group :development do
2323
end
2424

2525
group :test do
26+
gem 'danger', require: false
27+
gem 'danger-changelog', require: false
28+
gem 'danger-pr-comment', require: false
29+
gem 'danger-toc', require: false
2630
gem 'rack-contrib', require: false
2731
gem 'rack-test', '~> 2.1'
2832
gem 'rspec', '~> 3.13'

0 commit comments

Comments
 (0)