diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml index 5db94de..759cce9 100644 --- a/.github/workflows/sonarqube.yaml +++ b/.github/workflows/sonarqube.yaml @@ -45,7 +45,7 @@ jobs: - name: Check if PR is from a fork id: check_fork - if: ${{ github.event.pull_request.head.repo.full_name != 'dtcenter/METdataio' }} + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'dtcenter/METdataio' }} run: echo "SonarQube scan cannot be run from a fork"; exit 1 - uses: actions/checkout@v4 with: