diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml index fa3b928..d7c6b46 100644 --- a/.github/workflows/sonar-scan.yml +++ b/.github/workflows/sonar-scan.yml @@ -1,26 +1,35 @@ name: Sonar Qube Scan on: - workflow_dispatch: + pull_request: jobs: sonarcloud: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: - # Disabling shallow clone is recommended for improving relevancy of reporting + # Disabling shallow clone is recommended for improving relevancy of reporting fetch-depth: 0 - name: SonarQube Scan uses: sonarsource/sonarqube-scan-action@master with: projectBaseDir: . args: > - -Dsonar.projectKey=python-app + -Dsonar.projectKey=${{ github.event.repository.name }} env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - - name: SonarQube Quality Gate check - uses: sonarsource/sonarqube-quality-gate-action@master - timeout-minutes: 5 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: Esperando resultados do SonarQube Quality Gate + run: sleep 15 + + - name: SonarQube Pull Request Comment + uses: campos-pay/sonarqube-pr-comment@dev + if: always() + with: + sonar_token: ${{ secrets.SONAR_TOKEN }} + sonar_host_url: ${{ secrets.SONAR_HOST_URL }} + sonar_projectkey: ${{ github.event.repository.name }} + github-token: ${{ secrets.GITHUB_TOKEN }} + repo_name: ${{ github.repository }} + pr_number: ${{ github.event.pull_request.number }} diff --git a/telegram_bot/networking/vyos.py b/telegram_bot/networking/vyos.py index a74051f..81d5b25 100644 --- a/telegram_bot/networking/vyos.py +++ b/telegram_bot/networking/vyos.py @@ -41,3 +41,4 @@ def vyos_policy(): if __name__ == '__main__': vyos_policy() +