From caf0f2354c586d347136e39ec919c0ba241fe411 Mon Sep 17 00:00:00 2001
From: Rodrigo Nascimento <rodrigoknascimento@gmail.com>
Date: Sat, 2 Dec 2017 19:28:38 -0200
Subject: [PATCH] Send change log to testflight (#124)

---
 .circleci/changelog.sh | 7 +++++++
 .circleci/config.yml   | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)
 create mode 100644 .circleci/changelog.sh

diff --git a/.circleci/changelog.sh b/.circleci/changelog.sh
new file mode 100644
index 000000000..deb042836
--- /dev/null
+++ b/.circleci/changelog.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+git log --format="%cd" -n 14 --date=short | sort -u -r | while read DATE ; do
+    echo $DATE
+    GIT_PAGER=cat git log --no-merges --format="- %s" --since="$DATE 00:00:00" --until="$DATE 24:00:00"
+	echo
+done
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 51eb5edc9..37f74a1b7 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -137,6 +137,7 @@ jobs:
       - run:
           name: Install NPM modules
           command: |
+            rm -rf node_modules
             npm install
             npm install react-native
 
@@ -185,7 +186,7 @@ jobs:
           name: Fastlane Tesflight Upload
           command: |
             cd ios
-            fastlane pilot upload
+            fastlane pilot upload --changelog "$(sh ../.circleci/changelog.sh)"
 
 workflows:
   version: 2
-- 
GitLab