Skip to content

Commit c6087fb

Browse files
dblockclaude
andcommitted
Migrate Danger to use danger-pr-comment workflow.
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent f3b7eac commit c6087fb

6 files changed

Lines changed: 32 additions & 17 deletions

File tree

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: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
name: PR Linter
2-
on: [pull_request]
1+
name: Danger
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, edited, synchronize]
6+
37
jobs:
48
danger:
5-
runs-on: ubuntu-latest
6-
steps:
7-
- uses: actions/checkout@v3
8-
with:
9-
fetch-depth: 0
10-
- uses: ruby/setup-ruby@v1
11-
with:
12-
ruby-version: 2.7
13-
bundler-cache: true
14-
- run: |
15-
# Personal access token for dangerpr-bot - public, but base64 encoded to avoid tripping up GitHub
16-
TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode)
17-
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: '2.7'
13+
bundler-cache: true

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### 1.1.0 (Next)
22
* Your contribution here.
3+
* [#21](https://github.com/mongoid/mongoid-compatibility/pull/21): Migrate Danger to use danger-pr-comment workflow - [@dblock](https://github.com/dblock).
34
* [#20](https://github.com/mongoid/mongoid-compatibility/pull/20): Add gem caching to CI - [@saisrinivasan](https://github.com/SairamSrinivasan).
45

56
### 1.0.0 (2024/06/19)

Dangerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# frozen_string_literal: true
22

3-
danger.import_dangerfile(gem: 'mongoid-danger')
3+
danger.import_dangerfile(gem: 'danger-pr-comment')
4+
5+
changelog.check!

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
source 'http://rubygems.org'
44

55
gemspec
6+
7+
group :test do
8+
gem 'danger', require: false
9+
gem 'danger-changelog', require: false
10+
gem 'danger-pr-comment', require: false
11+
end

mongoid-compatibility.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
1919
s.add_dependency 'mongoid', '>= 2.0'
2020

2121
s.add_development_dependency 'appraisal', '~> 2.0'
22-
s.add_development_dependency 'mongoid-danger', '~> 0.2'
2322
s.add_development_dependency 'rake', '< 12'
2423
s.add_development_dependency 'rspec'
2524
s.add_development_dependency 'rubocop', '~> 1.36.0'

0 commit comments

Comments
 (0)