-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add ability to use OIDC to report coverage #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,10 @@ inputs: | |
description: 'HEAD commit for which the Test Coverage report is being sent' | ||
required: false | ||
default: ${{ github.event.pull_request.head.sha }} | ||
use-oidc: | ||
description: 'Use OIDC token instead of DSN. Allowed values are — true, false' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Clarify the 'use-oidc' input description by replacing the em dash with clear language (e.g. 'Allowed values: "true" or "false"'). Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
required: false | ||
default: 'false' | ||
branding: | ||
color: 'green' | ||
icon: 'umbrella' | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -11,6 +11,7 @@ | |||||
"dsn": "INPUT_DSN", | ||||||
"fail_ci_on_error": "INPUT_FAIL-CI-ON-ERROR", | ||||||
"commit_sha": "INPUT_COMMIT-SHA", | ||||||
"use_oidc": "INPUT_USE-OIDC", | ||||||
} | ||||||
|
||||||
DEEPSOURCE_CLI_PATH = "/app/bin/deepsource" | ||||||
|
@@ -54,6 +55,9 @@ def main() -> None: | |||||
input_data["coverage_file"], | ||||||
] | ||||||
|
||||||
if input_data["use_oidc"] == "true": | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Consider converting the input value to a native boolean (e.g., using a lower case conversion or a boolean cast) to simplify condition checking and mitigate case sensitivity issues.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
command.append("--use-oidc") | ||||||
|
||||||
# change the current working directory to the GitHub repository's context | ||||||
os.chdir(GITHUB_WORKSPACE_PATH) | ||||||
|
||||||
|
@@ -68,10 +72,9 @@ def main() -> None: | |||||
capture_output=True, | ||||||
) | ||||||
|
||||||
if process.returncode != 0: | ||||||
if input_data["fail_ci_on_error"] == "true": | ||||||
print(f"::error file:main.py::{process.stdout.decode('utf-8')}") | ||||||
sys.exit(1) | ||||||
if process.returncode != 0 and input_data["fail_ci_on_error"] == "true": | ||||||
print(f"::error file:main.py::{process.stdout.decode('utf-8')}") | ||||||
sys.exit(1) | ||||||
|
||||||
print(process.stdout.decode("utf-8")) | ||||||
print(process.stderr.decode("utf-8"), file=sys.stderr) | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.