Skip to content

Commit b971e0e

Browse files
committed
[#494] Replace danger-ruby with danger-kotlin
1 parent c6cc06d commit b971e0e

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

.github/workflows/review_pull_request.yml

+1-24
Original file line numberDiff line numberDiff line change
@@ -69,30 +69,7 @@ jobs:
6969
working-directory: ./template-compose
7070
run: ./gradlew koverMergedXmlReport
7171

72-
- name: Set up Ruby
73-
uses: ruby/setup-ruby@v1
74-
with:
75-
ruby-version: '2.7'
76-
77-
- name: Cache gems
78-
uses: actions/cache@v2
79-
with:
80-
path: vendor/bundle
81-
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
82-
restore-keys: |
83-
${{ runner.os }}-gems-
84-
85-
- name: Install Bundle and check environment versions
86-
run: |
87-
echo 'Install Bundle'
88-
bundle config path vendor/bundle
89-
bundle install
90-
echo 'Check environment setup versions'
91-
ruby --version
92-
gem --version
93-
bundler --version
94-
9572
- name: Run Danger
73+
uses: danger/kotlin@1.2.0
9674
env:
9775
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98-
run: bundle exec danger

Dangerfile.df.kts

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import systems.danger.kotlin.*
2+
3+
danger(args) {
4+
onGitHub {
5+
// Make it more obvious that a PR is a work in progress and shouldn't be merged yet
6+
if (pullRequest.title.contains("WIP")) {
7+
warn("PR is classed as Work in Progress")
8+
}
9+
10+
// Warn to encourage a PR description
11+
if (pullRequest.body.isBlank()) {
12+
warn("Please provide a summary in the PR description to make it easier to review")
13+
}
14+
15+
// Warn to encourage that labels should have been used on the PR
16+
if (pullRequest.labels.isEmpty()) {
17+
warn("Please add labels to this PR")
18+
}
19+
}
20+
21+
onGit {
22+
// Warn when there is a big PR
23+
if (lineOfCode > 500) {
24+
warn("Big PR")
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)