Made "gitlab:projectVariable:create" action idempotent

Signed-off-by: Bogdan Nechyporenko <bnechyporenko@bol.com>
This commit is contained in:
Bogdan Nechyporenko
2025-03-14 21:15:00 +01:00
parent 85df833fe3
commit 36af946105
2 changed files with 16 additions and 6 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-gitlab': patch
---
Made "gitlab:projectVariable:create" action idempotent
@@ -88,12 +88,17 @@ export const createGitlabProjectVariableAction = (options: {
const api = getClient({ host, integrations, token });
await api.ProjectVariables.create(projectId, key, value, {
variableType: variableType as VariableType,
protected: variableProtected,
masked,
raw,
environmentScope,
await ctx.checkpoint({
key: `create.project.variables.${projectId}.${key}.${value}`,
fn: async () => {
await api.ProjectVariables.create(projectId, key, value, {
variableType: variableType as VariableType,
protected: variableProtected,
masked,
raw,
environmentScope,
});
},
});
},
});