mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 21:55:48 +03:00
Merge pull request #10459 from nextcloud/repo-sync/android-common/master
🔄 Synced file(s) with nextcloud/android-common
This commit is contained in:
commit
0aa8924edd
2 changed files with 24 additions and 21 deletions
34
.github/workflows/detectNewJavaFiles.yml
vendored
34
.github/workflows/detectNewJavaFiles.yml
vendored
|
@ -1,18 +1,32 @@
|
||||||
name: "Detect new java files"
|
name: "Detect new java files"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master, stable-* ]
|
branches: [ master, stable-* ]
|
||||||
|
|
||||||
# Declare default permissions as read only.
|
|
||||||
permissions: read-all
|
permissions: read-all
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
detectNewJavaFiles:
|
detectNewJavaFiles:
|
||||||
runs-on: ubuntu-latest
|
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
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: trilom/file-changes-action@v1.2.4
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Detect new java files
|
|
||||||
run: scripts/analysis/detectNewJavaFiles.sh
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!/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
|
|
||||||
|
|
Loading…
Reference in a new issue