From f88da45de6aef4b83bd8ac1fda465412a0047de0 Mon Sep 17 00:00:00 2001 From: Joaquin Esteban Ponte Diaz Date: Sat, 21 Oct 2023 17:17:46 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20Add=20Custom=20Loggin?= =?UTF-8?q?g=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/scan-dependencies.yml | 74 +++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/scan-dependencies.yml diff --git a/.github/workflows/scan-dependencies.yml b/.github/workflows/scan-dependencies.yml new file mode 100644 index 0000000..888805a --- /dev/null +++ b/.github/workflows/scan-dependencies.yml @@ -0,0 +1,74 @@ +########################################################################## +# Scan Maven Dependencies +########################################################################## + +name: scan-dependencies +on: + workflow_call: + +jobs: + + ########################################################################## + # BUILD MULESOFT SERVICE + ########################################################################## + + build: + name: scan + runs-on: ubuntu-latest + + steps: + - name: Get the source code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Cache local Maven repository + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Setup JDK 8 + uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'temurin' + cache: 'maven' + + - name: Scan maven dependencies + shell: bash + run: | + echo " " + echo "***********************************************" + echo "Scan plugins" + echo "***********************************************" + echo " " + SCAN_RESULT=$(mvn versions:display-plugin-updates) + + if [[ $SCAN_RESULT == *"The following plugin updates are available"* ]]; then + echo " ***********************************************" + echo " Update plugins!!" + echo " ***********************************************" + echo " " + echo $SCAN_RESULT + else + echo "Plugins up to date" + fi + + echo " " + echo "***********************************************" + echo "Scan dependencies" + echo "***********************************************" + echo " " + if [[ $SCAN_RESULT == *"have newer versions"* ]]; then + echo " ***********************************************" + echo " Update dependencies!!" + echo " ***********************************************" + echo " " + echo $SCAN_RESULT + else + echo "Dependencies up to date" + fi +