From c4adbf25f907221c850ae7256d7eeea3ab054b4f Mon Sep 17 00:00:00 2001 From: nextcloud-android-bot Date: Thu, 30 Jun 2022 07:42:56 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20Synced=20local=20'.github/workfl?= =?UTF-8?q?ows/'=20with=20remote=20'config/workflows/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nextcloud-android-bot --- .github/workflows/detectNewJavaFiles.yml | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/detectNewJavaFiles.yml diff --git a/.github/workflows/detectNewJavaFiles.yml b/.github/workflows/detectNewJavaFiles.yml new file mode 100644 index 000000000..cda6fccae --- /dev/null +++ b/.github/workflows/detectNewJavaFiles.yml @@ -0,0 +1,32 @@ +name: "Detect new java files" + +on: + pull_request: + branches: [ master, stable-* ] + +permissions: read-all + +jobs: + detectNewJavaFiles: + runs-on: ubuntu-latest + steps: + - id: file_changes + uses: trilom/file-changes-action@v1.2.4 + with: + output: ',' + - name: Detect new java files + run: | + if [ -z '${{ steps.file_changes.outputs.files_added }}' ]; then + echo "No new files added" + exit 0 + fi + new_java=$(echo '${{ steps.file_changes.outputs.files_added }}' | tr ',' '\n' | grep '\.java$' | cat) + if [ -n "$new_java" ]; then + # shellcheck disable=SC2016 + printf 'New java files detected:\n```\n%s\n```\n' "$new_java" | tee "$GITHUB_STEP_SUMMARY" + exit 1 + else + echo "No new java files detected" + exit 0 + fi +