Merge pull request #29234 from acierto/githubpagesenable

Made "github:pages:enable" action idempotent
This commit is contained in:
Ben Lambert
2025-03-17 08:33:40 +01:00
committed by GitHub
2 changed files with 20 additions and 10 deletions
+5
View File
@@ -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',
},
});
},
});