name: Analyse SonarQube 
on: [push]

jobs:
  sonarqube:
    name: SonarQube Trigger
    runs-on: ubuntu-latest
    steps:
    - name: Debug Gitea variables
      run: |
        echo "GITEA_REF: ${GITEA_REF}"
        echo "GITEA_SHA: ${GITEA_SHA}"
        echo "All env variables:"
        env 
    - name: Checking out
      uses: actions/checkout@v4
      with:
        # Disabling shallow clone is recommended for improving relevancy of reporting
        fetch-depth: 0
    - name: SonarQube Scan
      uses: SonarSource/sonarqube-scan-action@v7.0.0
      args: >
       -Dsonar.projectKey=pki-manager
       -Dsonar.sources=. \
       -Dsonar.host.url=https://sonarqube.bv.stef.lan
      env:
        SONAR_TOKEN: sqp_953fd89437ce44f1aba0aca1cd768bfec9ab90d0 
        SONAR_HOST_URL: https://sonarqube.bv.stef.lan 
