diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 5de223fc6..8436fcf2e 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -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