Update maven-build.yml

This commit is contained in:
saisrinisrinivas 2023-09-02 18:41:25 +05:30 committed by GitHub
parent de688fe4a3
commit 7b9c12a93d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,29 +1,26 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
name: Print Changed Folders
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
branches:
- main
jobs:
build:
print-changed-folders:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '17' ]
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{matrix.java}}
uses: actions/setup-java@v2
with:
java-version: ${{matrix.java}}
distribution: 'adopt'
cache: maven
- name: Build with Maven Wrapper
run: ./mvnw -B package
- name: Checkout code
uses: actions/checkout@v2
- name: Check for changes in apps folder
id: check-changes
run: |
CHANGED_FOLDERS=$(git diff --name-only HEAD^ HEAD | grep '^apps/' | cut -d/ -f2- | cut -d/ -f1 | sort -u)
echo "::set-output name=folders::$CHANGED_FOLDERS"
- name: Print folder names
run: |
echo "Changed folders:"
IFS=$'\n' read -rd '' -a FOLDERS <<< "${{ steps.check-changes.outputs.folders }}"
for folder in "${FOLDERS[@]}"; do
echo "- $folder"
done