Skip to content

Commit

Permalink
👌 IMPROVE: Add Custom Logging action
Browse files Browse the repository at this point in the history
  • Loading branch information
jpontdia committed Oct 22, 2023
1 parent f74f400 commit f88da45
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/scan-dependencies.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f88da45

Please sign in to comment.