From 4a4acc31e69923f6c8107182f3c72b8efcf68e83 Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 12 May 2025 12:14:24 +0300 Subject: [PATCH] Fix coverity yml --- .github/workflows/coverity_scan.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/coverity_scan.yml b/.github/workflows/coverity_scan.yml index 13f09939..19eeca71 100644 --- a/.github/workflows/coverity_scan.yml +++ b/.github/workflows/coverity_scan.yml @@ -7,7 +7,6 @@ permissions: jobs: coverity_scan: - if: github.event_name == 'pull_request' runs-on: ubuntu-latest name: Coverity Scan steps: @@ -35,8 +34,18 @@ jobs: - name: Submit results to Coverity run: | tar czf cov-int.tgz cov-int - curl --form token="${{ secrets.COVERITY_TOKEN }}" \ - --form file=@cov-int.tgz \ - --form version="GitHub PR #${{ github.event.pull_request.number }}" \ - --form description="CI run for PR" \ - https://scan.coverity.com/builds?project=gabime%2Fspdlog + response=$(curl --silent --show-error --fail \ + --form token="${{ secrets.COVERITY_TOKEN }}" \ + --form file=@cov-int.tgz \ + --form version="GitHub PR #${{ github.event.pull_request.number }}" \ + --form description="CI run for PR" \ + https://scan.coverity.com/builds?project=gabime%2Fspdlog) + + echo "$response" + + if echo "$response" | grep -qi "Build successfully submitted"; then + echo "Coverity upload succeeded" + else + echo "Coverity upload failed or was rejected" + exit 1 + fi