File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - master
7+
8+ jobs :
9+ danger :
10+ runs-on : ubuntu-latest
11+ if : github.event_name == 'pull_request' # if only run pull request when multiple trigger workflow
12+ steps :
13+ - uses : actions/checkout@v2
14+ - name : Setup Ruby & Bundle
15+ uses : ruby/setup-ruby@v1
16+ with :
17+ ruby-version : ' 2.6'
18+ bundler-cache : true
19+ - uses : MeilCli/danger-action@v5
20+ with :
21+ plugins_file : ' Gemfile'
22+ install_path : ' vendor/bundle'
23+ danger_file : ' Dangerfile'
24+ danger_id : ' danger-pr'
25+ env :
26+ DANGER_GITHUB_API_TOKEN : ${{ secrets.DANGER_GITHUB_API_TOKEN }}
Original file line number Diff line number Diff line change 1+ # Sometimes it's a README fix, or something like that - which isn't relevant for
2+ # including in a project's CHANGELOG for example
3+ declared_trivial = github . pr_title . include? "#trivial"
4+
5+ # Make it more obvious that a PR is a work in progress and shouldn't be merged yet
6+ warn ( "PR is classed as Work in Progress" ) if github . pr_title . include? "[WIP]"
7+
8+ # Warn when there is a big PR
9+ warn ( "Big PR" ) if git . lines_of_code > 500
10+
11+ # Don't let testing shortcuts get into master by accident
12+ fail ( "fdescribe left in tests" ) if `grep -r fdescribe specs/ ` . length > 1
13+ fail ( "fit left in tests" ) if `grep -r fit specs/ ` . length > 1
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ Gem::Specification.new do |spec|
5555 spec . add_development_dependency ( "rubocop-performance" , "~> 1.11" )
5656 spec . add_development_dependency ( "rubocop-rake" , "~> 0.6" )
5757 spec . add_development_dependency ( "rubocop-thread_safety" , "~> 0.4" )
58+ spec . add_development_dependency ( "danger" , "~> 8.4" )
5859 end
5960 if coverage
6061 spec . add_development_dependency ( "simplecov" , "~> 0.21" )
You can’t perform that action at this time.
0 commit comments