2022-12-16 12:37:14 +03:00
|
|
|
# synced from @nextcloud/android-config
|
2024-02-29 22:23:51 +03:00
|
|
|
|
|
|
|
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
# SPDX-FileCopyrightText: 2023 Andy Scherzinger <info@andy-scherzinger.de>
|
|
|
|
# SPDX-FileCopyrightText: 2022 Tobias Kaminsky <tobias@kaminsky.me>
|
|
|
|
# SPDX-FileCopyrightText: 2022 Álvaro Brey <alvaro@alvarobrey.com>
|
2024-03-29 21:22:56 +03:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
2024-02-29 22:23:51 +03:00
|
|
|
|
2022-04-07 12:51:01 +03:00
|
|
|
name: "Detect new java files"
|
|
|
|
|
|
|
|
on:
|
2022-06-30 10:42:52 +03:00
|
|
|
pull_request:
|
2022-07-21 14:57:11 +03:00
|
|
|
branches: [ master, main, stable-* ]
|
2022-04-07 12:51:01 +03:00
|
|
|
|
2022-06-10 09:03:43 +03:00
|
|
|
permissions: read-all
|
|
|
|
|
2023-06-08 10:39:30 +03:00
|
|
|
concurrency:
|
|
|
|
group: detect-new-java-files-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-04-07 12:51:01 +03:00
|
|
|
jobs:
|
2022-06-30 10:42:52 +03:00
|
|
|
detectNewJavaFiles:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-12-16 11:57:01 +03:00
|
|
|
- id: file_changes
|
|
|
|
uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b # 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
|