Made "github:issues:label" action idempotent
Signed-off-by: Bogdan Nechyporenko <bnechyporenko@bol.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user