Merge pull request #29285 from acierto/githubautolinkscreate

Made "github:autolinks:create" action idempotent
This commit is contained in:
Ben Lambert
2025-03-20 08:43:53 +01:00
committed by GitHub
2 changed files with 18 additions and 8 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-github': patch
---
Made "github:autolinks:create" action idempotent
@@ -108,15 +108,20 @@ export function createGithubAutolinksAction(options: {
}),
);
await client.rest.repos.createAutolink({
owner,
repo,
key_prefix: keyPrefix,
url_template: urlTemplate,
is_alphanumeric: isAlphanumeric,
});
await ctx.checkpoint({
key: `create.auto.link.${owner}.${repo}`,
fn: async () => {
await client.rest.repos.createAutolink({
owner,
repo,
key_prefix: keyPrefix,
url_template: urlTemplate,
is_alphanumeric: isAlphanumeric,
});
ctx.logger.info(`Autolink reference created successfully`);
ctx.logger.info(`Autolink reference created successfully`);
},
});
},
});
}