From 3d51f634252f3d3a9294b38aac8d3263a7006605 Mon Sep 17 00:00:00 2001 From: Ivan Smirnov <52702497+ivanmolodec@users.noreply.github.com> Date: Mon, 12 Feb 2024 11:33:33 +0300 Subject: [PATCH] Update sonar.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавлена проверка пулл-реквестов --- .github/workflows/sonar.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 451206cf..41c63a86 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -2,6 +2,7 @@ name: QA on: push: + pull_request: workflow_dispatch: jobs: @@ -29,4 +30,16 @@ jobs: run: sonar-scanner -Dsonar.host.url=https://sonar.openbsl.ru -Dsonar.branch.name=${{ env.BRANCH_NAME }} + # Анализ проекта в SonarQube (пулл-реквест) + - name: Анализ в SonarQube (pull-request) + if: github.event_name == 'pull_request' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: sonar-scanner + -Dsonar.host.url=https://sonar.openbsl.ru + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} + -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} + -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} + -Dsonar.scm.revision=${{ github.event.pull_request.head.sha }}