Skip to content

Sonar Analysis - Scheduled #231

Sonar Analysis - Scheduled

Sonar Analysis - Scheduled #231

# 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: graphql-dxm-provider
jobs:
sonar-analysis:
name: Sonar Analysis
runs-on: self-hosted
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:
mvn_settings_filepath: '.github/maven.settings.xml'
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
- 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 }}
nvd_apikey: ${{ secrets.NVD_APIKEY }}
mvn_settings_filepath: '.github/maven.settings.xml'