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 name: Print Changed Folders
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on: on:
push: push:
branches: [ main ] branches:
pull_request: - main
branches: [ main ]
jobs: jobs:
build: print-changed-folders:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
java: [ '17' ]
steps: steps:
- uses: actions/checkout@v3 - name: Checkout code
- name: Set up JDK ${{matrix.java}} uses: actions/checkout@v2
uses: actions/setup-java@v2
with: - name: Check for changes in apps folder
java-version: ${{matrix.java}} id: check-changes
distribution: 'adopt' run: |
cache: maven CHANGED_FOLDERS=$(git diff --name-only HEAD^ HEAD | grep '^apps/' | cut -d/ -f2- | cut -d/ -f1 | sort -u)
- name: Build with Maven Wrapper echo "::set-output name=folders::$CHANGED_FOLDERS"
run: ./mvnw -B package
- 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