Skip to content

Commit e055e2f

Browse files
authored
Merge pull request #2651 from dblock/migrate-danger-pr-comment
Migrate Danger to use danger-pr-comment workflow
2 parents ebe5476 + 7d138f2 commit e055e2f

File tree

5 files changed

+30
-20
lines changed

5 files changed

+30
-20
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@v0.1.0
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/danger-run.yml@v0.1.0
10+
secrets: inherit
11+
with:
12+
ruby-version: '3.4'
13+
bundler-cache: true

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* [#2648](https://github.com/ruby-grape/grape/pull/2648): Remove deprecated ParamsBuilders extensions - [@ericproulx](https://github.com/ericproulx).
1717
* [#2645](https://github.com/ruby-grape/grape/pull/2645): Endpoints are compiled when API is compiled - [@ericproulx](https://github.com/ericproulx).
1818
* [#2647](https://github.com/ruby-grape/grape/pull/2647): Explicit kwargs for `namespace` and `route_param` - [@ericproulx](https://github.com/ericproulx).
19+
* [#2651](https://github.com/ruby-grape/grape/pull/2651): Migrate Danger to use danger-pr-comment workflow - [@dblock](https://github.com/dblock).
1920
* Your contribution here.
2021

2122
#### Fixes

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
@@ -23,10 +23,13 @@ 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'
29-
gem 'ruby-grape-danger', '~> 0.2', require: false
3033
gem 'simplecov', '~> 0.21', require: false
3134
gem 'simplecov-lcov', '~> 0.8', require: false
3235
gem 'test-prof', require: false

0 commit comments

Comments
 (0)