Signed-off-by: tobiasKaminsky <tobias@kaminsky.me> Co-authored-by: Álvaro Brey <alvaro.brey@nextcloud.com> Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@@ -0,0 +1,15 @@
+name: "Detect new java files"
+
+on:
+ pull_request:
+ branches: [ master, stable-* ]
+jobs:
+ detectNewJavaFiles:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: trilom/file-changes-action@v1.2.3
+ - uses: actions/checkout@v2
+ - name: Detect new java files
+ run: scripts/analysis/detectNewJavaFiles.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+count=$(grep \.java\" -c "$HOME"/files_added.json)
+if [ "$count" -eq 0 ] ; then
+ exit 0
+else
+ echo "New Java files detected! Please use Kotlin for new files. Number of new Java files: $count"
+ exit 1
+fi