diff --git a/.github/actions/reports-group/codacy-uploader/action.yml b/.github/actions/reports-group/codacy-uploader/action.yml index a6ab97cd..a569441a 100644 --- a/.github/actions/reports-group/codacy-uploader/action.yml +++ b/.github/actions/reports-group/codacy-uploader/action.yml @@ -12,6 +12,14 @@ inputs: description: | Indicates whether to follow symbolic links when resolving `path` default: 'true' + override-commit: + description: | + Commit to link to the uploaded reports. + Default value: + - `push` workflow: `github.sha` + - `pull_request` workflow: `github.event.pull_request.head.sha` + - `workflow_run` workflow triggered by a `pull_request` or `push` workflow: `github.event.workflow_run.head_sha` + default: "${{ ('workflow_run' == github.event_name && ('pull_request' == github.event.workflow_run.event || 'push' == github.event.workflow_run.event) && github.event.workflow_run.head_sha) || ('pull_request' == github.event_name && github.event.pull_request.head.sha) || ('push' == github.event_name && github.sha) || null }}" outputs: groups: @@ -78,6 +86,9 @@ runs: - name: Upload to codacy id: upload uses: codacy/codacy-coverage-reporter-action@v1 + env: + GITHUB_SHA: ${{ inputs.override-commit }} # Lonely way to override the commit without having to deal with CLI uploader directly :/ + GITHUB_EVENT_NAME: push # Force the event to "push" to be sure uploader will leverage GITHUB_SHA and not something else (mostly in case event is `pull_request`) with: coverage-reports: ${{ steps.build-uploader-options.outputs.coverage-reports }} project-token: ${{ inputs.project-token }} diff --git a/.github/actions/reports-group/codecov-uploader/action.yml b/.github/actions/reports-group/codecov-uploader/action.yml index a68e4f70..fe810c78 100644 --- a/.github/actions/reports-group/codecov-uploader/action.yml +++ b/.github/actions/reports-group/codecov-uploader/action.yml @@ -16,9 +16,10 @@ inputs: description: | Commit to link to the uploaded reports. Default value: - - `push` and `pull_request` workflow: `github.event.after` + - `push` workflow: `github.sha` + - `pull_request` workflow: `github.event.pull_request.head.sha` - `workflow_run` workflow triggered by a `pull_request` or `push` workflow: `github.event.workflow_run.head_sha` - default: "${{ ('workflow_run' == github.event_name && ('pull_request' == github.event.workflow_run.event || 'push' == github.event.workflow_run.event) && github.event.workflow_run.head_sha) || (('pull_request' == github.event_name || 'push' == github.event_name) && github.event.pull_request.head.sha) || null }}" + default: "${{ ('workflow_run' == github.event_name && ('pull_request' == github.event.workflow_run.event || 'push' == github.event.workflow_run.event) && github.event.workflow_run.head_sha) || ('pull_request' == github.event_name && github.event.pull_request.head.sha) || ('push' == github.event_name && github.sha) || null }}" override-branch: description: | Branch to link to the uploaded reports.