Made "github:issues:label" action idempotent

Signed-off-by: Bogdan Nechyporenko <bnechyporenko@bol.com>
This commit is contained in:
Bogdan Nechyporenko
2025-03-14 22:15:15 +01:00
parent 85df833fe3
commit 8c3868751c
2 changed files with 15 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-github': patch
---
Made "github:issues:label" action idempotent
@@ -101,11 +101,16 @@ export function createGithubIssuesLabelAction(options: {
);
try {
await client.rest.issues.addLabels({
owner,
repo,
issue_number: number,
labels,
await ctx.checkpoint({
key: `github.issues.add.label.${owner}.${repo}.${number}`,
fn: async () => {
await client.rest.issues.addLabels({
owner,
repo,
issue_number: number,
labels,
});
},
});
} catch (e) {
assertError(e);