check for 500 char limit

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2019-03-20 09:03:58 +01:00
parent 7c28461679
commit 3de3904ea0
No known key found for this signature in database
GPG Key ID: 0E00D4D47D0C5AF7
2 changed files with 26 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#1: GIT_USERNAME
#2: GIT_TOKEN
@ -110,7 +110,18 @@ else
findbugsMessage="<h1>Findbugs increased!</h1>"
fi
curl -u $1:$2 -X POST https://api.github.com/repos/nextcloud/android/issues/$7/comments -d "{ \"body\" : \"$lintResult $findbugsResultNew $findbugsResultOld $checkLibraryMessage $lintMessage $findbugsMessage \" }"
# check gplay limitation: all changelog files must only have 500 chars
gplayLimitation=$(scripts/checkGplayLimitation.sh)
if [ ! -z "$gplayLimitation" ]; then
gplayLimitation="<h1>Following files are beyond 500 char limit:</h1><br><br>"$gplayLimitation
fi
curl -u $1:$2 -X POST https://api.github.com/repos/nextcloud/android/issues/$7/comments -d "{ \"body\" : \"$lintResult $findbugsResultNew $findbugsResultOld $checkLibraryMessage $lintMessage $findbugsMessage $gplayLimitation \" }"
if [ ! -z "$gplayLimitation" ]; then
exit 1
fi
if [ $checkLibrary -eq 1 ]; then
exit 1

13
scripts/checkGplayLimitation.sh Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
result=""
for log in fastlane/metadata/android/*/changelogs/*
do
if [[ -e $log && $(wc -m $log | cut -d" " -f1) -gt 500 ]]
then
result=$log"<br>"$result
fi
done
echo -e "$result";