diff --git a/src/index.ts b/src/index.ts index 27b0e7c..990a4c4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -118,8 +118,18 @@ async function main () { id: github.context.runId.toString() }) snapshot.addManifest(manifest) - snapshot.sha = core.getInput('snapshot-sha') - snapshot.ref = core.getInput('snapshot-ref') + + const inputSHA = core.getInput('sha') + if (inputSHA !== '') { + // only set the SHA if it is not empty; otherwise, use the SHA from the context + snapshot.sha = inputSHA + } + + const inputRef = core.getInput('ref') + if (inputRef !== '') { + // only set the ref if it is not empty; otherwise, use the ref from the context + snapshot.ref = inputRef + } submitSnapshot(snapshot) }