chore: update workflows from templates #68
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Detect new java files" | |
on: | |
pull_request: | |
branches: [ master, main, stable-* ] | |
permissions: read-all | |
jobs: | |
detectNewJavaFiles: | |
runs-on: ubuntu-latest | |
steps: | |
- id: file_changes | |
uses: trilom/[email protected] | |
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 | |