Skip to content

Commit dd9a3e5

Browse files
authored
Update danger workflows (#88)
The changes simplify the workflow setup by reusing shared workflows, and add a new workflow to handle Danger comments.
1 parent f1579ed commit dd9a3e5

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
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: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
1-
name: danger
2-
on: pull_request
1+
name: Danger
2+
on:
3+
pull_request:
4+
types: [opened, reopened, edited, synchronize]
35

46
jobs:
57
danger:
6-
runs-on: ubuntu-latest
7-
steps:
8-
- uses: actions/checkout@v4
9-
with:
10-
fetch-depth: 100
11-
- name: Set up Ruby
12-
uses: ruby/setup-ruby@v1
13-
with:
14-
ruby-version: 3.2
15-
bundler-cache: true
16-
rubygems: latest
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
8+
uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@main
9+
secrets: inherit
10+
with:
11+
ruby-version: "3.2"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#### Fixes
88

99
* Your contribution here.
10+
* [#88](https://github.com/ruby-grape/grape-swagger-entity/pull/88): Update danger workflows - [@numbata](https://github.com/numbata).
1011

1112
### 0.7.0 (2025/08/02)
1213

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ end
4444

4545
group :test do
4646
gem 'grape-entity', grape_entity_spec
47-
gem 'ruby-grape-danger', '~> 0.2.1', require: false
47+
gem 'ruby-grape-danger', '~> 0.3.0', require: false
4848
gem 'simplecov', require: false
4949
end

lib/grape-swagger/entity/parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def parse_nested(entity_name, entity_options, parent_model = nil)
111111
.map(&:nested_exposures)
112112
.flatten
113113
.each_with_object({}) do |value, memo|
114-
memo[value.attribute] = value.send(:options)
114+
memo[value.attribute] = value.send(:options)
115115
end
116116

117117
properties, required = parse_grape_entity_params(params, nested_entities.last)

0 commit comments

Comments
 (0)