From e2222be533778792f738f09ae6ac70850167ba48 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Thu, 29 Jan 2026 09:22:09 -0800 Subject: [PATCH] Migrate Danger to use danger-pr-comment workflow Co-authored-by: GitHub Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/danger-comment.yml | 11 +++++++++++ .github/workflows/danger.yml | 22 ++++++++-------------- CHANGELOG.md | 1 + Dangerfile | 4 +++- Gemfile | 4 +++- 5 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/danger-comment.yml diff --git a/.github/workflows/danger-comment.yml b/.github/workflows/danger-comment.yml new file mode 100644 index 0000000..8e15cb6 --- /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 c2db24e..fff2c6a 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -1,17 +1,11 @@ name: Danger -on: [pull_request] +on: + pull_request: + types: [opened, reopened, edited, synchronize] + jobs: danger: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 - bundler-cache: true - - run: | - # Personal access token for dangerpr-bot - public, but base64 encoded to avoid tripping up GitHub - TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | 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.1" diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d23b10..46a99ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## 0.5.0 (next) +* [#152](https://github.com/mongoid/mongoid_search/pull/152): Migrate Danger to use danger-pr-comment workflow - [@dblock](https://github.com/dblock). * Your contribution here. * [#146](https://github.com/mongoid/mongoid_search/pull/146): Update dependencies and switch to Github Actions - [@yads](https://github.com/yads). diff --git a/Dangerfile b/Dangerfile index de2a4a0..f769387 100644 --- a/Dangerfile +++ b/Dangerfile @@ -1,3 +1,5 @@ # frozen_string_literal: true -danger.import_dangerfile(gem: 'mongoid-danger') +danger.import_dangerfile(gem: 'danger-pr-comment') + +changelog.check! diff --git a/Gemfile b/Gemfile index 752316d..2121dbc 100644 --- a/Gemfile +++ b/Gemfile @@ -24,5 +24,7 @@ group :development do end group :test do - gem 'mongoid-danger', '~> 0.2.0', require: false + gem 'danger', require: false + gem 'danger-changelog', require: false + gem 'danger-pr-comment', require: false end