-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
42 lines (38 loc) · 1.54 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const core = require('@actions/core');
const axios = require('axios').default;
try {
const appId = core.getInput('appId');
const envId = core.getInput('envId');
const apiVersionId = core.getInput('versionId');
const commitId = core.getInput('commitId');
const runId = core.getInput('runId');
const configurableUpdateURL = core.getInput('configurableUpdateURL');
const configMatch = core.getInput('configCheckStatus');
if (configMatch === "success") {
let successMsg = "Configurable Check Success";
console.log(successMsg);
updateRudderWithNewConfigurables(configurableUpdateURL, appId, envId, apiVersionId, commitId, runId, configMatch);
}
} catch (error) {
console.log(error, "Configurable check status update failed !");
}
function updateRudderWithNewConfigurables(configurableUpdateURL, appId, envId, apiVersionId, commitId, runId, status) {
if(configurableUpdateURL != "") {
const payload = {
"appId": appId,
"environmentId": envId,
"apiVersionId": apiVersionId,
"commitId": commitId,
"runId": parseInt(runId),
"status": status
};
axios.post(configurableUpdateURL, payload).then(function (response) {
console.log("choreo-configurable-update-status", "updated");
console.log("Config Update Status : " + response.status);
})
.catch(function (error) {
console.log("choreo-status", "failed");
console.log(error);
});
}
}