Compare commits

...

2 Commits

Author SHA1 Message Date
Vlad Suhomlinov 7446b95552 refactor: correct script path 2021-09-02 20:11:52 +03:00
Vlad Suhomlinov 343f2f4f16 feat: add danger 2021-09-02 20:05:33 +03:00
3 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,6 @@
diff = git.diff_for_file("CPDLog.txt")
isCopypasteAdded = (diff.insertions - diff.deletions) > 0
if diff && isCopypasteAdded
fail("Кажется, добавилась копипаста в коде 😞 Надо её убрать 🧰", sticky: false)
end

View File

@ -0,0 +1,2 @@
# Warn when there is a big PR
warn("Размер pull-request''а слишком большой!") if git.lines_of_code > 600

View File

@ -0,0 +1,34 @@
name: pull-request
on:
pull_request:
branches-ignore:
- 'master'
- 'main'
- 'dev'
- 'develop'
- 'develop*'
- 'release/**'
jobs:
danger:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true
- name: Run pr size checker
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec danger --dangerfile ".github/workflows/danger_pr_size"
- name: Run copypaste detector
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec danger --dangerfile ".github/workflows/danger_copypaste"