Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - [#494] Replace danger-ruby with danger-kotlin #498

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions .github/workflows/review_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,30 +69,7 @@ jobs:
working-directory: ./template-compose
run: ./gradlew koverMergedXmlReport

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'

- name: Cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-

- name: Install Bundle and check environment versions
run: |
echo 'Install Bundle'
bundle config path vendor/bundle
bundle install
echo 'Check environment setup versions'
ruby --version
gem --version
bundler --version

- name: Run Danger
uses: danger/[email protected]
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec danger
20 changes: 20 additions & 0 deletions Dangerfile.df.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import systems.danger.kotlin.*

danger(args) {
onGitHub {
// Make it more obvious that a PR is a work in progress and shouldn't be merged yet
if (pullRequest.title.contains("WIP", false)) {
warn("PR is classed as Work in Progress")
}

// Warn when there is a big PR
if ((pullRequest.additions ?: 0) - (pullRequest.deletions ?: 0) > 500) {
warn("Big PR")
}

// Warn to encourage a PR description
if (pullRequest.body?.isBlank() == true) {
warn("Please provide a summary in the PR description to make it easier to review")
}
}
}