Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-3085 Augment CI by adding code coverage and code quality reporting (#900)

Lewis John McGibbney89e6ec17bb5a
diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
index 7083ebb04..cb6208a8f 100644
--- a/.github/workflows/sonarcloud.yml
+++ b/.github/workflows/sonarcloud.yml
@@ -64,6 +64,10 @@ jobs:
- name: Resolve PR number
id: pr
run: |
+ if [ "${{ github.event.workflow_run.event }}" != "pull_request" ]; then
+ echo "is_pr=false" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
PR_NUMBER=$(gh api \
"repos/${{ github.repository }}/commits/${{ github.event.workflow_run.head_sha }}/pulls" \
--jq '.[0].number // empty')
@@ -82,7 +86,7 @@ jobs:
args: >
-Dsonar.pullrequest.key=${{ steps.pr.outputs.number }}
-Dsonar.pullrequest.branch=${{ github.event.workflow_run.head_branch }}
- -Dsonar.pullrequest.base=${{ github.event.workflow_run.event == 'pull_request' && 'master' || 'master' }}
+ -Dsonar.pullrequest.base=master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: https://sonarcloud.io