Skip to content

Commit 2e3862f

Browse files
authored
✨ Adds danger config (#300)
* ✨ Adds danger config
1 parent fc3f455 commit 2e3862f

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.circleci/config.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
version: 2
22
jobs:
3+
danger:
4+
docker:
5+
- image: dantoml/danger:latest
6+
steps:
7+
- checkout
8+
- run: danger
39
test_module:
410
working_directory: ~/project
511
docker:
@@ -102,11 +108,11 @@ jobs:
102108
- run: Escape react-native publish
103109

104110

105-
106111
workflows:
107112
version: 2
108113
publish:
109114
jobs:
115+
- danger
110116
- test_module
111117
- test_sample
112118
- hold:

Dangerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
has_app_changes = !git.modified_files.grep(/lib/).empty?
2+
declared_trivial = (github.pr_title + github.pr_body).include?("#trivial") || !has_app_changes || github.pr_labels.include?("trivial")
3+
4+
5+
# Make sure PR has a description.
6+
if github.pr_body.length < 3 && git.lines_of_code > 10
7+
fail "Please provide a summary of the changes in the pull request description."
8+
end
9+
10+
if !git.modified_files.include?("CHANGELOG.md") && !declared_trivial
11+
fail("Please include a CHANGELOG entry. \nYou can find it at [CHANGELOG.md](https://github.com/Instabug/Instabug-Flutter/blob/master/CHANGELOG.md).", sticky: false)
12+
end

0 commit comments

Comments
 (0)