Use actionsUtil.computeAutomationID on upload-lib

This commit is contained in:
David Verdeguer 2021-05-03 19:56:04 +02:00
parent c93cbc943a
commit 3b741b35ad
12 changed files with 67 additions and 157 deletions

11
lib/actions-util.js generated
View file

@ -355,8 +355,13 @@ async function getAnalysisKey() {
}
exports.getAnalysisKey = getAnalysisKey;
async function getAutomationID() {
let automationID = `${await getAnalysisKey()}/`;
const environment = getOptionalInput("matrix");
const analysis_key = await getAnalysisKey();
const environment = getRequiredInput("matrix");
return computeAutomationID(analysis_key, environment);
}
exports.getAutomationID = getAutomationID;
function computeAutomationID(analysis_key, environment) {
let automationID = `${analysis_key}/`;
// the id has to be deterministic so we sort the fields
if (environment !== undefined && environment !== "null") {
const environmentObject = JSON.parse(environment);
@ -373,7 +378,7 @@ async function getAutomationID() {
}
return automationID;
}
exports.getAutomationID = getAutomationID;
exports.computeAutomationID = computeAutomationID;
/**
* Get the ref currently being analyzed.
*/