@@ -24,41 +24,36 @@ jobs:
2424 uses : actions/checkout@v4
2525 with :
2626 fetch-depth : 0
27- # workflow_run checks out the default branch, report the commit that was tested
28- ref : ${{ github.event.workflow_run.head_sha }}
2927
3028 - name : Download coverage report
3129 id : download
32- continue-on-error : true
3330 uses : actions/download-artifact@v4
3431 with :
3532 name : coverage-reports-linux
33+ # without a token the action ignores run-id and looks in the current run
34+ github-token : ${{ github.token }}
3635 run-id : ${{ github.event.workflow_run.id }}
3736
3837 - name : Report python coverage
39- if : ${{ !cancelled() && steps.download.outcome == 'success' && hashFiles('coverage.xml') != '' }}
38+ if : ${{ !cancelled() && steps.download.outcome == 'success' }}
4039 uses : codacy/codacy-coverage-reporter-action@v1
4140 with :
4241 project-token : ${{ secrets.CODACY_PROJECT_TOKEN }}
4342 language : python
4443 coverage-reports : coverage.xml
4544
4645 - name : Report c++ coverage
47- if : ${{ !cancelled() && steps.download.outcome == 'success' && hashFiles('coverage.info') != '' }}
46+ if : ${{ !cancelled() && steps.download.outcome == 'success' }}
4847 uses : codacy/codacy-coverage-reporter-action@v1
4948 with :
5049 project-token : ${{ secrets.CODACY_PROJECT_TOKEN }}
5150 language : cpp
5251 coverage-reports : coverage.info
5352
5453 - name : Report c coverage
55- if : ${{ !cancelled() && steps.download.outcome == 'success' && hashFiles('coverage.info') != '' }}
54+ if : ${{ !cancelled() && steps.download.outcome == 'success' }}
5655 uses : codacy/codacy-coverage-reporter-action@v1
5756 with :
5857 project-token : ${{ secrets.CODACY_PROJECT_TOKEN }}
5958 language : c
6059 coverage-reports : coverage.info
61-
62- - name : Warn when there is nothing to report
63- if : ${{ !cancelled() && steps.download.outcome != 'success' }}
64- run : echo "::warning::coverage-reports-linux not found in the Tests run, nothing was sent to Codacy"
0 commit comments