From 31b7edc318d7d8c1e9780d888dc051869b0e6efd Mon Sep 17 00:00:00 2001 From: Alex Babrykovich Date: Wed, 17 Jul 2024 10:06:41 +0300 Subject: [PATCH] ci: look for sonarqube comment for PR only (#162) --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f19d14f..19c8e3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -223,12 +223,13 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - uses: peter-evans/find-comment@v3 + if: github.event_name == 'pull_request' id: find_comment with: issue-number: ${{ github.event.pull_request.number }} body-includes: SonarQube Execution - uses: peter-evans/create-or-update-comment@v4 - if: steps.find_comment.outputs.comment-id == null && steps.write_access.outputs.granted == 'false' + if: github.event_name == 'pull_request' && steps.find_comment.outputs.comment-id == null && steps.write_access.outputs.granted == 'false' with: body: | SonarQube Execution Skipped. `${{ github.triggering_actor }}` does not have permissions on this repo. Maintainers will rerun it manually @@ -237,7 +238,7 @@ jobs: issue-number: ${{ github.event.pull_request.number }} token: ${{ secrets.GITHUB_TOKEN }} - uses: peter-evans/create-or-update-comment@v4 - if: steps.find_comment.outputs.comment-id != null && steps.write_access.outputs.granted == 'true' + if: github.event_name == 'pull_request' && steps.find_comment.outputs.comment-id != null && steps.write_access.outputs.granted == 'true' with: body: |