mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 21:29:20 +00:00
Update Checkly envars only if changed
This commit is contained in:
@@ -1706,11 +1706,12 @@ const syncSecretsCheckly = async ({
|
||||
if (!(key in getSecretsRes)) {
|
||||
// case: secret does not exist in checkly
|
||||
// -> add secret
|
||||
|
||||
await standardRequest.post(
|
||||
`${INTEGRATION_CHECKLY_API_URL}/v1/variables`,
|
||||
{
|
||||
key,
|
||||
value: secrets[key] ? secrets[key] : 'EMPTY'
|
||||
value: secrets[key]
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
@@ -1724,10 +1725,12 @@ const syncSecretsCheckly = async ({
|
||||
} else {
|
||||
// case: secret exists in checkly
|
||||
// -> update/set secret
|
||||
|
||||
if (secrets[key] !== getSecretsRes[key]) {
|
||||
await standardRequest.put(
|
||||
`${INTEGRATION_CHECKLY_API_URL}/v1/variables/${key}`,
|
||||
{
|
||||
value: secrets[key] ? secrets[key] : 'EMPTY'
|
||||
value: secrets[key]
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
@@ -1740,6 +1743,7 @@ const syncSecretsCheckly = async ({
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for await (const key of Object.keys(getSecretsRes)) {
|
||||
if (!(key in secrets)){
|
||||
|
||||
Reference in New Issue
Block a user