Add sha and ref snapshot inputs
This commit is contained in:
@@ -36,6 +36,12 @@ inputs:
|
||||
detector-url:
|
||||
description: 'The URL of the detector. If provided, detector-name and detector-version must also be provided.'
|
||||
required: false
|
||||
snapshot-sha:
|
||||
description: 'The SHA of the commit to associate with the snapshot. If provided, snapshot-ref must also be provided.'
|
||||
required: false
|
||||
snapshot-ref:
|
||||
description: 'The Git reference to associate with the snapshot. If provided, snapshot-sha must also be provided.'
|
||||
required: false
|
||||
runs:
|
||||
using: 'node20'
|
||||
main: 'dist/index.js'
|
||||
|
||||
12
index.ts
12
index.ts
@@ -60,6 +60,18 @@ async function run() {
|
||||
snapshot.addManifest(manifest);
|
||||
});
|
||||
|
||||
// Override snapshot ref and sha if provided
|
||||
const snapshotSha = core.getInput("snapshot-sha")?.trim();
|
||||
const snapshotRef = core.getInput("snapshot-ref")?.trim();
|
||||
|
||||
if (snapshotSha) {
|
||||
snapshot.sha = snapshotSha;
|
||||
}
|
||||
|
||||
if (snapshotRef) {
|
||||
snapshot.ref = snapshotRef;
|
||||
}
|
||||
|
||||
submitSnapshot(snapshot);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user