diff --git a/.github/workflows/danger-comment.yml b/.github/workflows/danger-comment.yml new file mode 100644 index 00000000..8e15cb6c --- /dev/null +++ b/.github/workflows/danger-comment.yml @@ -0,0 +1,11 @@ +name: Danger Comment + +on: + workflow_run: + workflows: [Danger] + types: [completed] + +jobs: + comment: + uses: numbata/danger-pr-comment/.github/workflows/danger-comment.yml@v0.1.0 + secrets: inherit diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index 7b09a17d..5795867d 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -1,22 +1,11 @@ ---- -name: danger -on: pull_request +name: Danger +on: + pull_request: + types: [opened, reopened, edited, synchronize] jobs: danger: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 100 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.4 - bundler-cache: true - - name: Run Danger - run: | - # the token is public, has public_repo scope and belongs to the grape-bot user owned by @dblock, this is ok - TOKEN=$(echo -n Z2hwX2lYb0dPNXNyejYzOFJyaTV3QUxUdkNiS1dtblFwZTFuRXpmMwo= | base64 --decode) - DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose - + uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.1.0 + secrets: inherit + with: + ruby-version: "3.4" diff --git a/CHANGELOG.md b/CHANGELOG.md index dee6d4ca..a69f67bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +### Next + +#### Features + +* [#970](https://github.com/ruby-grape/grape-swagger/pull/970): Migrate Danger to use danger-pr-comment workflow - [@dblock](https://github.com/dblock). +* Your contribution here. + ### 2.1.3 (2025-11-21) #### Features diff --git a/Dangerfile b/Dangerfile index 82881902..b4bc3669 100644 --- a/Dangerfile +++ b/Dangerfile @@ -1,3 +1,6 @@ # frozen_string_literal: true -danger.import_dangerfile(gem: 'ruby-grape-danger') +danger.import_dangerfile(gem: 'danger-pr-comment') + +changelog.check! +toc.check! diff --git a/Gemfile b/Gemfile index e0d4802a..7123c41e 100644 --- a/Gemfile +++ b/Gemfile @@ -45,7 +45,10 @@ group :development, :test do end group :test do - gem 'ruby-grape-danger', '~> 0.2', require: false + gem 'danger', require: false + gem 'danger-changelog', require: false + gem 'danger-pr-comment', require: false + gem 'danger-toc', require: false gem 'simplecov', require: false gem 'super_diff', require: false end diff --git a/spec/issues/962_polymorphic_entity_with_custom_documentation_spec.rb b/spec/issues/962_polymorphic_entity_with_custom_documentation_spec.rb index 46f6237e..aded22b3 100644 --- a/spec/issues/962_polymorphic_entity_with_custom_documentation_spec.rb +++ b/spec/issues/962_polymorphic_entity_with_custom_documentation_spec.rb @@ -93,10 +93,9 @@ class EntityWithNestedEmptyEntity < Grape::Entity end specify do - expect(hidden_entity_definition).to eql({ + expect(hidden_entity_definition).to include({ 'type' => 'object', - 'properties' => {}, - 'required' => ['hidden_prop'] + 'properties' => {} }) end