-
Notifications
You must be signed in to change notification settings - Fork 32
add inputs used by autosubmission #87
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds optional inputs for autosubmission metadata and forwards them into the snapshot submission call, while preserving backward compatibility.
- Introduces a
SnapshotDetector
type and logic to readdetector-name
,detector-version
, anddetector-url
inputs (with defaults if none provided). - Adds
snapshot-sha
andsnapshot-ref
inputs and assigns them to theSnapshot
object. - Updates
action.yml
to declare all five new inputs.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/index.ts | Added SnapshotDetector type, parsed detector and snapshot inputs, and assigned sha /ref . |
action.yml | Declared new inputs: snapshot-sha , snapshot-ref , detector-* . |
Comments suppressed due to low confidence (1)
src/index.ts:113
- The new code paths for setting
snapshot.sha
andsnapshot.ref
are not covered by existing tests. Consider adding unit or integration tests to verify these inputs are correctly read and assigned.
snapshot.sha = core.getInput('snapshot-sha')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see a few places where we need to derive the default if not provided by the inputs
enforce all detector vars present or not present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🙌🏻
const inputSHA = core.getInput('sha') | ||
if (inputSHA !== '') { | ||
snapshot.sha = inputSHA | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, good to see this backwards compatibility
Description
Adding inputs for autosubmission and passing them through to the snapshot submission call.
New Inputs:
Backward Compatibility
All new inputs are optional. If any of detector-name, detector-version, or detector-url, they all are required.
If only one or two are provided, an error is raised.
If none are specified, then the hardcoded values used prior to this PR are used as default values. This maintains backward compatibility for anyone using this action directly.