Merge pull request #29227 from acierto/gitlabprojectVariablecreate

Made "gitlab:projectVariable:create" action idempotent
This commit is contained in:
Ben Lambert
2025-03-17 08:36:43 +01:00
committed by GitHub
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,
});
},
});
},
});