diff --git a/.github/workflows/sq-pr.yml b/.github/workflows/sq-pr.yml new file mode 100644 index 00000000..0f8f3bb2 --- /dev/null +++ b/.github/workflows/sq-pr.yml @@ -0,0 +1,28 @@ +name: Анализ в SonarQube (pull-request) + +on: [pull_request] + +jobs: + SonarScanner: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + repository: ${{ github.event.workflow_run.head_repository.full_name }} + ref: ${{ github.event.workflow_run.head_branch }} + fetch-depth: 0 + + # https://docs.sonarqube.org/latest/analysis/pull-request/ + - name: Анализ в SonarQube (pull-request) + if: github.event_name == 'pull_request' + uses: alkoleft/sonar-quality-gate@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GIT_URL: "https://api.github.com" + GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_URL: https://sonar.openbsl.ru + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + GITHUB_REPOSITORY: bia-technologies/yaxunit + CI_MERGE_REQUEST_IID: ${{ github.event.pull_request.number }} + DEBUG: ${{ runner.debug }} diff --git a/.github/workflows/sq.yml b/.github/workflows/sq.yml index e214d199..42654d91 100644 --- a/.github/workflows/sq.yml +++ b/.github/workflows/sq.yml @@ -1,6 +1,8 @@ name: sq-analyze -on: [push, pull_request] +on: + - push + # - pull_request jobs: SonarScanner: diff --git a/sonar-project.properties b/sonar-project.properties index 95289ab9..624497e7 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -12,4 +12,7 @@ sonar.inclusions=**/*.bsl, **/*.os # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 -sonar.bsl.languageserver.configurationPath=.bsl-language-server.json \ No newline at end of file +sonar.bsl.languageserver.configurationPath=.bsl-language-server.json +sonar.qualitygate.wait=true +sonar.organization=bia-technologies +sonar.host.url=https://sonar.openbsl.ru \ No newline at end of file