Made "github:pages:enable" 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:pages:enable" action idempotent
|
||||
@@ -118,16 +118,21 @@ export function createGithubPagesEnableAction(options: {
|
||||
`Attempting to enable GitHub Pages for ${owner}/${repo} with "${buildType}" build type, on source branch "${sourceBranch}" and source path "${sourcePath}"`,
|
||||
);
|
||||
|
||||
await client.request('POST /repos/{owner}/{repo}/pages', {
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
build_type: buildType,
|
||||
source: {
|
||||
branch: sourceBranch,
|
||||
path: sourcePath,
|
||||
},
|
||||
headers: {
|
||||
'X-GitHub-Api-Version': '2022-11-28',
|
||||
await ctx.checkpoint({
|
||||
key: `enabled.github.pages.${owner}.${repo}`,
|
||||
fn: async () => {
|
||||
await client.request('POST /repos/{owner}/{repo}/pages', {
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
build_type: buildType,
|
||||
source: {
|
||||
branch: sourceBranch,
|
||||
path: sourcePath,
|
||||
},
|
||||
headers: {
|
||||
'X-GitHub-Api-Version': '2022-11-28',
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user