Skip to content

Sonar Analysis - Scheduled #245

Sonar Analysis - Scheduled

Sonar Analysis - Scheduled #245

# This workflow trigger a full Sonar analysis at regular interval
# Github actions command reference: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
name: Sonar Analysis - Scheduled
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * 1,3,5' # At 4AM, on Monday, Wednesday and Friday
env:
MODULE_ID: jcontent
jobs:
sonar-analysis:
name: Sonar Analysis
runs-on: ubuntu-latest
env:
NEXUS_INTERNAL_URL: ${{ secrets.NEXUS_INTERNAL_URL }}
strategy:
fail-fast: false
matrix:
supported_branches: ["${{ github.event.repository.default_branch }}"]
container:
image: jahia/cimg-mvn-cache:ga_cimg_openjdk_11.0.20-node
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.supported_branches }}
- uses: jahia/jahia-modules-action/build@v2
with:
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
mvn_settings_filepath: '.github/maven.settings.xml'
- uses: jahia/jahia-modules-action/sonar-analysis@v2
with:
primary_release_branch: ${{ matrix.supported_branches }}
build_artifacts: ''
github_pr_id: ${{github.event.number}}
sonar_url: ${{ secrets.SONAR_URL }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
mvn_settings_filepath: '.github/maven.settings.xml'
nvd_apikey: ${{ secrets.NVD_APIKEY }}