Skip to content

Enable repository scanning and Dockerfile validation #51

Enable repository scanning and Dockerfile validation

Enable repository scanning and Dockerfile validation #51

Workflow file for this run

name: SonarQube analysis
on:
# Trigger analysis when pushing in master or pull requests, and when creating
# a pull request.
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
sonarqube:
runs-on: ubuntu-latest
if: "${{ github.actor == github.repository_owner }}"
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
# Triggering SonarQube analysis as results of it are required by Quality Gate check
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# Check the Quality Gate status
- uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# Output from the Quality Gate
# The possible outputs of the "quality-gate-status" variable are "PASSED", "WARN" or "FAILED"
- name: "Example show SonarQube Quality Gate Status value"
if: always() # Run even if Quality Gate check failed
run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}"