diff --git a/action.yml b/action.yml index 8eb3471..fb4d3b6 100644 --- a/action.yml +++ b/action.yml @@ -3,7 +3,7 @@ description: 'GitHub Action that uploads test coverage reports to DeepSource for author: 'Sanket Saurav ' inputs: key: - description: 'Programming language shortcode for which coverage is reported. Allowed values are — python, go' + description: 'Programming language shortcode for which coverage is reported. Allowed values are — python, go, javascript, ruby, java, kotlin, scala, php, csharp, cxx, rust, swift' required: true coverage-file: description: 'Path to the coverage data file. e.g. ./coverage.xml' @@ -14,6 +14,10 @@ inputs: fail-ci-on-error: description: 'Should the CI build fail if there is an error while uploading the report to DeepSource? Allowed values are — true, false' default: false + commit-sha: + description: 'HEAD commit for which the Test Coverage report is being sent' + required: false + default: ${{ github.event.pull_request.head.sha }} branding: color: 'green' icon: 'umbrella' diff --git a/main.py b/main.py index b936fa3..54333ca 100755 --- a/main.py +++ b/main.py @@ -10,6 +10,7 @@ "coverage_file": "INPUT_COVERAGE-FILE", "dsn": "INPUT_DSN", "fail_ci_on_error": "INPUT_FAIL-CI-ON-ERROR", + "commit_sha": "INPUT_COMMIT-SHA", } DEEPSOURCE_CLI_PATH = "/app/bin/deepsource" @@ -45,7 +46,11 @@ def main() -> None: # skipcq: BAN-B603, PYL-W1510 process = subprocess.run( command, - env=dict(os.environ, DEEPSOURCE_DSN=input_data["dsn"]), + env=dict( + os.environ, + DEEPSOURCE_DSN=input_data["dsn"], + GHA_HEAD_COMMIT_SHA=input_data["commit_sha"], + ), capture_output=True, )