feat: add ability to use OIDC to report coverage#34
feat: add ability to use OIDC to report coverage#34srijan-deepsource wants to merge 2 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds support for using an OIDC token when reporting coverage instead of a DSN.
- Define a new
use-oidcAction input and map it inmain.py - Append
--use-oidcto the CLI command whenuse_oidcis true - Simplify the CI-failure exit logic into a single conditional
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| main.py | Map use_oidc, append --use-oidc flag, and merge error logic |
| action.yml | Introduce use-oidc input with description and default value |
Comments suppressed due to low confidence (1)
main.py:58
- Add a unit or integration test to verify that the
--use-oidcflag is appended only whenuse_oidcis set to 'true'.
if input_data["use_oidc"] == "true":
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Srijan Saurav <68371686+srijan-deepsource@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds the ability to report coverage using OIDC by introducing a new input parameter and updating the command-line arguments for the deepsource CLI execution.
- Added a new configuration key for OIDC in main.py
- Updated the CLI command to include a new flag when OIDC is enabled
- Introduced the "use-oidc" input in action.yml to configure this behavior
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| main.py | Added OIDC configuration and updated CLI command and error handling logic |
| action.yml | Added a new input for configuring the OIDC usage |
Comments suppressed due to low confidence (1)
main.py:14
- [nitpick] Consider using a consistent naming convention for environment variable keys; if underscores are preferred, consider renaming 'INPUT_USE-OIDC' to 'INPUT_USE_OIDC'.
"use_oidc": "INPUT_USE-OIDC",
| input_data["coverage_file"], | ||
| ] | ||
|
|
||
| if input_data["use_oidc"] == "true": |
There was a problem hiding this comment.
[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.
| if input_data["use_oidc"] == "true": | |
| if input_data["use_oidc"]: |
| 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.
[nitpick] Clarify the 'use-oidc' input description by replacing the em dash with clear language (e.g. 'Allowed values: "true" or "false"').
|
A description about |
No description provided.