mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 22:28:25 +00:00
Update Checkly envars only if changed
This commit is contained in:
@@ -1706,11 +1706,12 @@ const syncSecretsCheckly = async ({
|
|||||||
if (!(key in getSecretsRes)) {
|
if (!(key in getSecretsRes)) {
|
||||||
// case: secret does not exist in checkly
|
// case: secret does not exist in checkly
|
||||||
// -> add secret
|
// -> add secret
|
||||||
|
|
||||||
await standardRequest.post(
|
await standardRequest.post(
|
||||||
`${INTEGRATION_CHECKLY_API_URL}/v1/variables`,
|
`${INTEGRATION_CHECKLY_API_URL}/v1/variables`,
|
||||||
{
|
{
|
||||||
key,
|
key,
|
||||||
value: secrets[key] ? secrets[key] : 'EMPTY'
|
value: secrets[key]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
@@ -1724,20 +1725,23 @@ const syncSecretsCheckly = async ({
|
|||||||
} else {
|
} else {
|
||||||
// case: secret exists in checkly
|
// case: secret exists in checkly
|
||||||
// -> update/set secret
|
// -> update/set secret
|
||||||
await standardRequest.put(
|
|
||||||
`${INTEGRATION_CHECKLY_API_URL}/v1/variables/${key}`,
|
if (secrets[key] !== getSecretsRes[key]) {
|
||||||
{
|
await standardRequest.put(
|
||||||
value: secrets[key] ? secrets[key] : 'EMPTY'
|
`${INTEGRATION_CHECKLY_API_URL}/v1/variables/${key}`,
|
||||||
},
|
{
|
||||||
{
|
value: secrets[key]
|
||||||
headers: {
|
|
||||||
"Authorization": `Bearer ${accessToken}`,
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
"Accept": "application/json",
|
|
||||||
"X-Checkly-Account": integration.appId
|
|
||||||
},
|
},
|
||||||
}
|
{
|
||||||
);
|
headers: {
|
||||||
|
"Authorization": `Bearer ${accessToken}`,
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Accept": "application/json",
|
||||||
|
"X-Checkly-Account": integration.appId
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user