Add sha and ref snapshot inputs
This commit is contained in:
@@ -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'
|
||||||
|
|||||||
12
index.ts
12
index.ts
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user