diff --git a/.github/workflows/sonarsource.yml b/.github/workflows/sonarsource.yml index 2ecce9083..7aba036f1 100644 --- a/.github/workflows/sonarsource.yml +++ b/.github/workflows/sonarsource.yml @@ -1,17 +1,23 @@ name: SonarCloud on: - push: - branches: - - master pull_request: - types: [opened, synchronize, reopened] + types: [ labeled ] + +env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + jobs: build: name: Build and analyze + if: ${{ github.event.label.name == 'run-sonarsource' }} runs-on: ubuntu-latest env: BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed steps: + - name: Remove label + run: | + gh pr edit $PR_URL --remove-label run-sonarsource - name: Setup cmake uses: jwlawson/actions-setup-cmake@v2 with: