Add sha and ref snapshot inputs

This commit is contained in:
Lewis Jones
2025-06-16 11:15:10 +01:00
parent 779e8387fd
commit 348257c874
2 changed files with 18 additions and 0 deletions

View File

@@ -36,6 +36,12 @@ inputs:
detector-url: detector-url:
description: 'The URL of the detector. If provided, detector-name and detector-version must also be provided.' description: 'The URL of the detector. If provided, detector-name and detector-version must also be provided.'
required: false 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: runs:
using: 'node20' using: 'node20'
main: 'dist/index.js' main: 'dist/index.js'

View File

@@ -60,6 +60,18 @@ async function run() {
snapshot.addManifest(manifest); 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); submitSnapshot(snapshot);
} }