Skip to content

Commit 13d286a

Browse files
dblockclaude
andcommitted
Update Danger workflow to use reusable workflow.
Migrate from inline Danger workflow steps to numbata/danger-pr-comment reusable workflow for better maintainability and consistency. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent a035d2a commit 13d286a

File tree

4 files changed

+19
-19
lines changed

4 files changed

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

.github/workflows/danger.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
1-
---
2-
name: danger
1+
name: Danger
32
on:
43
pull_request:
54
types: [opened, reopened, edited, synchronize]
5+
66
jobs:
77
danger:
8-
runs-on: ubuntu-20.04
9-
steps:
10-
- uses: actions/checkout@v3
11-
with:
12-
fetch-depth: 0
13-
- name: Set up Ruby
14-
uses: ruby/setup-ruby@v1
15-
with:
16-
ruby-version: 2.7
17-
bundler-cache: true
18-
- name: Run Danger
19-
run: |
20-
# the personal token is public, this is ok, base64 encode to avoid tripping Github
21-
TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode)
22-
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose
8+
uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@main
9+
secrets: inherit

Dangerfile

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

3+
danger.import_dangerfile(gem: 'danger-pr-comment')
4+
35
changelog.check!
46
toc.check!

Gemfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ gem 'rake'
88

99
group :development, :test do
1010
gem 'danger'
11-
gem 'danger-changelog', '0.6.1'
12-
gem 'danger-toc', '0.2.0'
11+
gem 'danger-changelog'
12+
gem 'danger-toc'
13+
gem 'danger-pr-comment'
1314
gem 'rspec', '~> 3.0'
1415
gem 'rubocop', '~> 1.0'
1516
gem 'rubocop-rake'

0 commit comments

Comments
 (0)