fdroiddata/.gitlab-ci.yml
Hans-Christoph Steiner d6e81e47bb gitlab-ci: error if apps use insecure plain HTTP gradle repositories
It is very easy to mess up and include plain HTTP URLs for gradle
repositories, which can lead to gradle downloading code from HTTP and
immediately executing it.  The fix is almost always changing "http:" to
"https:".

https://max.computer/blog/how-to-take-over-the-computer-of-any-java-or-clojure-or-scala-developer
2018-01-26 13:41:41 +01:00

33 lines
1.2 KiB
YAML

image: registry.gitlab.com/fdroid/ci-images-server:latest
before_script:
- rm -rf fdroidserver
- git clone --depth=1 https://gitlab.com/fdroid/fdroidserver.git
- export PATH="$PWD/fdroidserver:$PATH"
- touch config.py
lint:
script:
# if this is a merge request fork, then only check relevant apps
- if [ "$CI_PROJECT_NAMESPACE" != "fdroid" ]; then
git fetch https://gitlab.com/fdroid/fdroiddata;
test -d build || mkdir build;
for f in `git diff --name-only FETCH_HEAD`; do
appid=`echo $f | sed -n -e 's,^metadata/\(.*\)\.txt,\1,p'
-e 's,^metadata/\(.*\)\.yml,\1,p'`;
export CHANGED="$CHANGED $appid";
grep -q "^Repo *Type\W *git" $f && git -C build clone `sed -n "s,^Repo *:,,p" $f` $appid;
done;
./tools/audit-gradle.py $CHANGED;
fi
- export EXITVALUE=0
- fdroid lint -f $CHANGED || {
export EXITVALUE=1;
printf "\nThese files have lint issues:\n";
fdroid rewritemeta -l $CHANGED;
printf "\nThese are the formatting issues:\n";
fdroid rewritemeta $CHANGED;
git --no-pager diff --color=always;
}
- exit $EXITVALUE