Skip to content

Commit 28aeb23

Browse files
dblockclaude
andcommitted
Migrate Danger to use danger-pr-comment workflow.
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent b7a67b5 commit 28aeb23

4 files changed

Lines changed: 26 additions & 19 deletions

File tree

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

.github/workflows/danger.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
name: Danger
2-
on: [pull_request]
2+
on:
3+
pull_request:
4+
types: [opened, reopened, synchronize, edited]
35
jobs:
4-
lint:
5-
runs-on: ubuntu-latest
6-
steps:
7-
- uses: actions/checkout@v5
8-
with:
9-
fetch-depth: 0
10-
- name: Set up Ruby
11-
uses: ruby/setup-ruby@v1
12-
with:
13-
ruby-version: "2.7"
14-
bundler-cache: true
15-
- name: Run Danger
16-
run: |
17-
# the token is public, has public_repo scope and belongs to the grape-bot user owned by @dblock, this is ok
18-
TOKEN=$(echo -n Z2hwX2lYb0dPNXNyejYzOFJyaTV3QUxUdkNiS1dtblFwZTFuRXpmMwo= | base64 --decode)
19-
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose
6+
danger:
7+
uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.1.0
8+
with:
9+
ruby-version: '3.4'
10+
bundler-cache: true
11+
secrets: inherit

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
@@ -34,7 +34,10 @@ group :development, :test do
3434
gem 'rubocop-capybara'
3535
gem 'rubocop-rake'
3636
gem 'rubocop-rspec'
37-
gem 'ruby-grape-danger', '~> 0.2.0', require: false
37+
gem 'danger', require: false
38+
gem 'danger-changelog', require: false
39+
gem 'danger-pr-comment', require: false
40+
gem 'danger-toc', require: false
3841
gem 'selenium-webdriver'
3942
gem 'sprockets', ENV.fetch('SPROCKETS_VERSION', '>= 4.0.0'), require: false
4043
gem 'sprockets-rails', require: false

0 commit comments

Comments
 (0)