Skip to content

Commit 348257c

Browse files
committed
Add sha and ref snapshot inputs
1 parent 779e838 commit 348257c

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ inputs:
3636
detector-url:
3737
description: 'The URL of the detector. If provided, detector-name and detector-version must also be provided.'
3838
required: false
39+
snapshot-sha:
40+
description: 'The SHA of the commit to associate with the snapshot. If provided, snapshot-ref must also be provided.'
41+
required: false
42+
snapshot-ref:
43+
description: 'The Git reference to associate with the snapshot. If provided, snapshot-sha must also be provided.'
44+
required: false
3945
runs:
4046
using: 'node20'
4147
main: 'dist/index.js'

index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ async function run() {
6060
snapshot.addManifest(manifest);
6161
});
6262

63+
// Override snapshot ref and sha if provided
64+
const snapshotSha = core.getInput("snapshot-sha")?.trim();
65+
const snapshotRef = core.getInput("snapshot-ref")?.trim();
66+
67+
if (snapshotSha) {
68+
snapshot.sha = snapshotSha;
69+
}
70+
71+
if (snapshotRef) {
72+
snapshot.ref = snapshotRef;
73+
}
74+
6375
submitSnapshot(snapshot);
6476
}
6577

0 commit comments

Comments
 (0)