@backstage/plugin-scaffolder-backend-module-github 0.5.1-next.1 → 0.5.1-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/actions/gitHelpers.cjs.js +90 -0
  3. package/dist/actions/gitHelpers.cjs.js.map +1 -0
  4. package/dist/actions/gitHubEnvironment.examples.cjs.js +340 -0
  5. package/dist/actions/gitHubEnvironment.examples.cjs.js.map +1 -0
  6. package/dist/actions/github.cjs.js +187 -0
  7. package/dist/actions/github.cjs.js.map +1 -0
  8. package/dist/actions/github.examples.cjs.js +60 -0
  9. package/dist/actions/github.examples.cjs.js.map +1 -0
  10. package/dist/actions/githubActionsDispatch.cjs.js +84 -0
  11. package/dist/actions/githubActionsDispatch.cjs.js.map +1 -0
  12. package/dist/actions/githubActionsDispatch.examples.cjs.js +66 -0
  13. package/dist/actions/githubActionsDispatch.examples.cjs.js.map +1 -0
  14. package/dist/actions/githubAutolinks.cjs.js +76 -0
  15. package/dist/actions/githubAutolinks.cjs.js.map +1 -0
  16. package/dist/actions/githubAutolinks.examples.cjs.js +30 -0
  17. package/dist/actions/githubAutolinks.examples.cjs.js.map +1 -0
  18. package/dist/actions/githubBranchProtection.cjs.js +97 -0
  19. package/dist/actions/githubBranchProtection.cjs.js.map +1 -0
  20. package/dist/actions/githubBranchProtection.examples.cjs.js +62 -0
  21. package/dist/actions/githubBranchProtection.examples.cjs.js.map +1 -0
  22. package/dist/actions/githubDeployKey.cjs.js +123 -0
  23. package/dist/actions/githubDeployKey.cjs.js.map +1 -0
  24. package/dist/actions/githubDeployKey.examples.cjs.js +30 -0
  25. package/dist/actions/githubDeployKey.examples.cjs.js.map +1 -0
  26. package/dist/actions/githubEnvironment.cjs.js +255 -0
  27. package/dist/actions/githubEnvironment.cjs.js.map +1 -0
  28. package/dist/actions/githubIssuesLabel.cjs.js +79 -0
  29. package/dist/actions/githubIssuesLabel.cjs.js.map +1 -0
  30. package/dist/actions/githubIssuesLabel.examples.cjs.js +46 -0
  31. package/dist/actions/githubIssuesLabel.examples.cjs.js.map +1 -0
  32. package/dist/actions/githubPagesEnable.cjs.js +88 -0
  33. package/dist/actions/githubPagesEnable.cjs.js.map +1 -0
  34. package/dist/actions/githubPagesEnable.examples.cjs.js +224 -0
  35. package/dist/actions/githubPagesEnable.examples.cjs.js.map +1 -0
  36. package/dist/actions/githubPullRequest.cjs.js +336 -0
  37. package/dist/actions/githubPullRequest.cjs.js.map +1 -0
  38. package/dist/actions/githubPullRequest.examples.cjs.js +260 -0
  39. package/dist/actions/githubPullRequest.examples.cjs.js.map +1 -0
  40. package/dist/actions/githubRepoCreate.cjs.js +130 -0
  41. package/dist/actions/githubRepoCreate.cjs.js.map +1 -0
  42. package/dist/actions/githubRepoCreate.examples.cjs.js +964 -0
  43. package/dist/actions/githubRepoCreate.examples.cjs.js.map +1 -0
  44. package/dist/actions/githubRepoPush.cjs.js +122 -0
  45. package/dist/actions/githubRepoPush.cjs.js.map +1 -0
  46. package/dist/actions/githubRepoPush.examples.cjs.js +57 -0
  47. package/dist/actions/githubRepoPush.examples.cjs.js.map +1 -0
  48. package/dist/actions/githubWebhook.cjs.js +135 -0
  49. package/dist/actions/githubWebhook.cjs.js.map +1 -0
  50. package/dist/actions/githubWebhook.examples.cjs.js +113 -0
  51. package/dist/actions/githubWebhook.examples.cjs.js.map +1 -0
  52. package/dist/actions/helpers.cjs.js +292 -0
  53. package/dist/actions/helpers.cjs.js.map +1 -0
  54. package/dist/actions/inputProperties.cjs.js +319 -0
  55. package/dist/actions/inputProperties.cjs.js.map +1 -0
  56. package/dist/actions/outputProperties.cjs.js +19 -0
  57. package/dist/actions/outputProperties.cjs.js.map +1 -0
  58. package/dist/index.cjs.js +31 -4306
  59. package/dist/index.cjs.js.map +1 -1
  60. package/dist/index.d.ts +33 -1
  61. package/dist/module.cjs.js +92 -0
  62. package/dist/module.cjs.js.map +1 -0
  63. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/actions/gitHelpers.ts","../src/actions/helpers.ts","../src/actions/githubActionsDispatch.examples.ts","../src/actions/githubActionsDispatch.ts","../src/actions/githubIssuesLabel.examples.ts","../src/actions/githubIssuesLabel.ts","../src/actions/inputProperties.ts","../src/actions/outputProperties.ts","../src/actions/githubRepoCreate.examples.ts","../src/actions/githubRepoCreate.ts","../src/actions/githubRepoPush.examples.ts","../src/actions/githubRepoPush.ts","../src/actions/githubWebhook.examples.ts","../src/actions/githubWebhook.ts","../src/actions/githubDeployKey.examples.ts","../src/actions/githubDeployKey.ts","../src/actions/gitHubEnvironment.examples.ts","../src/actions/githubEnvironment.ts","../src/actions/githubPullRequest.examples.ts","../src/actions/githubPullRequest.ts","../src/actions/github.examples.ts","../src/actions/github.ts","../src/actions/githubAutolinks.examples.ts","../src/actions/githubAutolinks.ts","../src/actions/githubPagesEnable.examples.ts","../src/actions/githubPagesEnable.ts","../src/module.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { assertError } from '@backstage/errors';\nimport { Octokit } from 'octokit';\nimport { LoggerService } from '@backstage/backend-plugin-api';\n\ntype BranchProtectionOptions = {\n client: Octokit;\n owner: string;\n repoName: string;\n logger: LoggerService;\n requireCodeOwnerReviews: boolean;\n requiredStatusCheckContexts?: string[];\n bypassPullRequestAllowances?: {\n users?: string[];\n teams?: string[];\n apps?: string[];\n };\n requiredApprovingReviewCount?: number;\n restrictions?: {\n users: string[];\n teams: string[];\n apps?: string[];\n };\n requireBranchesToBeUpToDate?: boolean;\n requiredConversationResolution?: boolean;\n requireLastPushApproval: boolean;\n defaultBranch?: string;\n enforceAdmins?: boolean;\n dismissStaleReviews?: boolean;\n requiredCommitSigning?: boolean;\n};\n\nexport const enableBranchProtectionOnDefaultRepoBranch = async ({\n repoName,\n client,\n owner,\n logger,\n requireCodeOwnerReviews,\n bypassPullRequestAllowances,\n requiredApprovingReviewCount,\n restrictions,\n requiredStatusCheckContexts = [],\n requireBranchesToBeUpToDate = true,\n requiredConversationResolution = false,\n requireLastPushApproval = false,\n defaultBranch = 'master',\n enforceAdmins = true,\n dismissStaleReviews = false,\n requiredCommitSigning = false,\n}: BranchProtectionOptions): Promise<void> => {\n const tryOnce = async () => {\n try {\n await client.rest.repos.updateBranchProtection({\n mediaType: {\n /**\n * 👇 we need this preview because allowing a custom\n * reviewer count on branch protection is a preview\n * feature\n *\n * More here: https://docs.github.com/en/rest/overview/api-previews#require-multiple-approving-reviews\n */\n previews: ['luke-cage-preview'],\n },\n owner,\n repo: repoName,\n branch: defaultBranch,\n required_status_checks: {\n strict: requireBranchesToBeUpToDate,\n contexts: requiredStatusCheckContexts,\n },\n restrictions: restrictions ?? null,\n enforce_admins: enforceAdmins,\n required_pull_request_reviews: {\n required_approving_review_count: requiredApprovingReviewCount,\n require_code_owner_reviews: requireCodeOwnerReviews,\n bypass_pull_request_allowances: bypassPullRequestAllowances,\n dismiss_stale_reviews: dismissStaleReviews,\n require_last_push_approval: requireLastPushApproval,\n },\n required_conversation_resolution: requiredConversationResolution,\n });\n\n if (requiredCommitSigning) {\n await client.rest.repos.createCommitSignatureProtection({\n owner,\n repo: repoName,\n branch: defaultBranch,\n });\n }\n } catch (e) {\n assertError(e);\n if (\n e.message.includes(\n 'Upgrade to GitHub Pro or make this repository public to enable this feature',\n )\n ) {\n logger.warn(\n 'Branch protection was not enabled as it requires GitHub Pro for private repositories',\n );\n } else {\n throw e;\n }\n }\n };\n\n try {\n await tryOnce();\n } catch (e) {\n if (!e.message.includes('Branch not found')) {\n throw e;\n }\n\n // GitHub has eventual consistency. Fail silently, wait, and try again.\n await new Promise(resolve => setTimeout(resolve, 600));\n await tryOnce();\n }\n};\n\nexport function entityRefToName(name: string): string {\n return name.replace(/^.*[:/]/g, '');\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config } from '@backstage/config';\nimport { assertError, InputError, NotFoundError } from '@backstage/errors';\nimport {\n DefaultGithubCredentialsProvider,\n GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport { OctokitOptions } from '@octokit/core/dist-types/types';\nimport { Octokit } from 'octokit';\n\nimport {\n getRepoSourceDirectory,\n initRepoAndPush,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\n\nimport Sodium from 'libsodium-wrappers';\nimport {\n enableBranchProtectionOnDefaultRepoBranch,\n entityRefToName,\n} from './gitHelpers';\nimport { LoggerService } from '@backstage/backend-plugin-api';\n\nconst DEFAULT_TIMEOUT_MS = 60_000;\n\n/**\n * Helper for generating octokit configuration options for given repoUrl.\n * If no token is provided, it will attempt to get a token from the credentials provider.\n * @public\n */\nexport async function getOctokitOptions(options: {\n integrations: ScmIntegrationRegistry;\n credentialsProvider?: GithubCredentialsProvider;\n token?: string;\n repoUrl: string;\n}): Promise<OctokitOptions> {\n const { integrations, credentialsProvider, repoUrl, token } = options;\n const { owner, repo, host } = parseRepoUrl(repoUrl, integrations);\n\n const requestOptions = {\n // set timeout to 60 seconds\n timeout: DEFAULT_TIMEOUT_MS,\n };\n\n if (!owner) {\n throw new InputError(`No owner provided for repo ${repoUrl}`);\n }\n\n const integrationConfig = integrations.github.byHost(host)?.config;\n\n if (!integrationConfig) {\n throw new InputError(`No integration for host ${host}`);\n }\n\n // short circuit the `githubCredentialsProvider` if there is a token provided by the caller already\n if (token) {\n return {\n auth: token,\n baseUrl: integrationConfig.apiBaseUrl,\n previews: ['nebula-preview'],\n request: requestOptions,\n };\n }\n\n const githubCredentialsProvider =\n credentialsProvider ??\n DefaultGithubCredentialsProvider.fromIntegrations(integrations);\n\n // TODO(blam): Consider changing this API to take host and repo instead of repoUrl, as we end up parsing in this function\n // and then parsing in the `getCredentials` function too the other side\n const { token: credentialProviderToken } =\n await githubCredentialsProvider.getCredentials({\n url: `https://${host}/${encodeURIComponent(owner)}/${encodeURIComponent(\n repo,\n )}`,\n });\n\n if (!credentialProviderToken) {\n throw new InputError(\n `No token available for host: ${host}, with owner ${owner}, and repo ${repo}`,\n );\n }\n\n return {\n auth: credentialProviderToken,\n baseUrl: integrationConfig.apiBaseUrl,\n previews: ['nebula-preview'],\n };\n}\n\nexport async function createGithubRepoWithCollaboratorsAndTopics(\n client: Octokit,\n repo: string,\n owner: string,\n repoVisibility: 'private' | 'internal' | 'public' | undefined,\n description: string | undefined,\n homepage: string | undefined,\n deleteBranchOnMerge: boolean,\n allowMergeCommit: boolean,\n allowSquashMerge: boolean,\n squashMergeCommitTitle: 'PR_TITLE' | 'COMMIT_OR_PR_TITLE' | undefined,\n squashMergeCommitMessage: 'PR_BODY' | 'COMMIT_MESSAGES' | 'BLANK' | undefined,\n allowRebaseMerge: boolean,\n allowAutoMerge: boolean,\n access: string | undefined,\n collaborators:\n | (\n | {\n user: string;\n access: string;\n }\n | {\n team: string;\n access: string;\n }\n | {\n /** @deprecated This field is deprecated in favor of team */\n username: string;\n access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';\n }\n )[]\n | undefined,\n hasProjects: boolean | undefined,\n hasWiki: boolean | undefined,\n hasIssues: boolean | undefined,\n topics: string[] | undefined,\n repoVariables: { [key: string]: string } | undefined,\n secrets: { [key: string]: string } | undefined,\n oidcCustomization:\n | {\n useDefault: boolean;\n includeClaimKeys?: string[];\n }\n | undefined,\n customProperties: { [key: string]: string } | undefined,\n logger: LoggerService,\n) {\n // eslint-disable-next-line testing-library/no-await-sync-queries\n const user = await client.rest.users.getByUsername({\n username: owner,\n });\n\n if (access?.startsWith(`${owner}/`)) {\n await validateAccessTeam(client, access);\n }\n\n const repoCreationPromise =\n user.data.type === 'Organization'\n ? client.rest.repos.createInOrg({\n name: repo,\n org: owner,\n private: repoVisibility === 'private',\n // @ts-ignore https://github.com/octokit/types.ts/issues/522\n visibility: repoVisibility,\n description: description,\n delete_branch_on_merge: deleteBranchOnMerge,\n allow_merge_commit: allowMergeCommit,\n allow_squash_merge: allowSquashMerge,\n squash_merge_commit_title: squashMergeCommitTitle,\n squash_merge_commit_message: squashMergeCommitMessage,\n allow_rebase_merge: allowRebaseMerge,\n allow_auto_merge: allowAutoMerge,\n homepage: homepage,\n has_projects: hasProjects,\n has_wiki: hasWiki,\n has_issues: hasIssues,\n // Custom properties only available on org repos\n custom_properties: customProperties,\n })\n : client.rest.repos.createForAuthenticatedUser({\n name: repo,\n private: repoVisibility === 'private',\n description: description,\n delete_branch_on_merge: deleteBranchOnMerge,\n allow_merge_commit: allowMergeCommit,\n allow_squash_merge: allowSquashMerge,\n squash_merge_commit_title: squashMergeCommitTitle,\n squash_merge_commit_message: squashMergeCommitMessage,\n allow_rebase_merge: allowRebaseMerge,\n allow_auto_merge: allowAutoMerge,\n homepage: homepage,\n has_projects: hasProjects,\n has_wiki: hasWiki,\n has_issues: hasIssues,\n });\n\n let newRepo;\n\n try {\n newRepo = (await repoCreationPromise).data;\n } catch (e) {\n assertError(e);\n if (e.message === 'Resource not accessible by integration') {\n logger.warn(\n `The GitHub app or token provided may not have the required permissions to create the ${user.data.type} repository ${owner}/${repo}.`,\n );\n }\n throw new Error(\n `Failed to create the ${user.data.type} repository ${owner}/${repo}, ${e.message}`,\n );\n }\n\n if (access?.startsWith(`${owner}/`)) {\n const [, team] = access.split('/');\n await client.rest.teams.addOrUpdateRepoPermissionsInOrg({\n org: owner,\n team_slug: team,\n owner,\n repo,\n permission: 'admin',\n });\n // No need to add access if it's the person who owns the personal account\n } else if (access && access !== owner) {\n await client.rest.repos.addCollaborator({\n owner,\n repo,\n username: access,\n permission: 'admin',\n });\n }\n\n if (collaborators) {\n for (const collaborator of collaborators) {\n try {\n if ('user' in collaborator) {\n await client.rest.repos.addCollaborator({\n owner,\n repo,\n username: entityRefToName(collaborator.user),\n permission: collaborator.access,\n });\n } else if ('team' in collaborator) {\n await client.rest.teams.addOrUpdateRepoPermissionsInOrg({\n org: owner,\n team_slug: entityRefToName(collaborator.team),\n owner,\n repo,\n permission: collaborator.access,\n });\n }\n } catch (e) {\n assertError(e);\n const name = extractCollaboratorName(collaborator);\n logger.warn(\n `Skipping ${collaborator.access} access for ${name}, ${e.message}`,\n );\n }\n }\n }\n\n if (topics) {\n try {\n await client.rest.repos.replaceAllTopics({\n owner,\n repo,\n names: topics.map(t => t.toLowerCase()),\n });\n } catch (e) {\n assertError(e);\n logger.warn(`Skipping topics ${topics.join(' ')}, ${e.message}`);\n }\n }\n\n for (const [key, value] of Object.entries(repoVariables ?? {})) {\n await client.rest.actions.createRepoVariable({\n owner,\n repo,\n name: key,\n value: value,\n });\n }\n\n if (secrets) {\n const publicKeyResponse = await client.rest.actions.getRepoPublicKey({\n owner,\n repo,\n });\n\n await Sodium.ready;\n const binaryKey = Sodium.from_base64(\n publicKeyResponse.data.key,\n Sodium.base64_variants.ORIGINAL,\n );\n for (const [key, value] of Object.entries(secrets)) {\n const binarySecret = Sodium.from_string(value);\n const encryptedBinarySecret = Sodium.crypto_box_seal(\n binarySecret,\n binaryKey,\n );\n const encryptedBase64Secret = Sodium.to_base64(\n encryptedBinarySecret,\n Sodium.base64_variants.ORIGINAL,\n );\n\n await client.rest.actions.createOrUpdateRepoSecret({\n owner,\n repo,\n secret_name: key,\n encrypted_value: encryptedBase64Secret,\n key_id: publicKeyResponse.data.key_id,\n });\n }\n }\n\n if (oidcCustomization) {\n await client.request(\n 'PUT /repos/{owner}/{repo}/actions/oidc/customization/sub',\n {\n owner,\n repo,\n use_default: oidcCustomization.useDefault,\n include_claim_keys: oidcCustomization.includeClaimKeys,\n },\n );\n }\n\n return newRepo;\n}\n\nexport async function initRepoPushAndProtect(\n remoteUrl: string,\n password: string,\n workspacePath: string,\n sourcePath: string | undefined,\n defaultBranch: string,\n protectDefaultBranch: boolean,\n protectEnforceAdmins: boolean,\n owner: string,\n client: Octokit,\n repo: string,\n requireCodeOwnerReviews: boolean,\n bypassPullRequestAllowances:\n | {\n users?: string[];\n teams?: string[];\n apps?: string[];\n }\n | undefined,\n requiredApprovingReviewCount: number,\n restrictions:\n | {\n users: string[];\n teams: string[];\n apps?: string[];\n }\n | undefined,\n requiredStatusCheckContexts: string[],\n requireBranchesToBeUpToDate: boolean,\n requiredConversationResolution: boolean,\n requireLastPushApproval: boolean,\n config: Config,\n logger: any,\n gitCommitMessage?: string,\n gitAuthorName?: string,\n gitAuthorEmail?: string,\n dismissStaleReviews?: boolean,\n requiredCommitSigning?: boolean,\n): Promise<{ commitHash: string }> {\n const gitAuthorInfo = {\n name: gitAuthorName\n ? gitAuthorName\n : config.getOptionalString('scaffolder.defaultAuthor.name'),\n email: gitAuthorEmail\n ? gitAuthorEmail\n : config.getOptionalString('scaffolder.defaultAuthor.email'),\n };\n\n const commitMessage =\n getGitCommitMessage(gitCommitMessage, config) || 'initial commit';\n\n const commitResult = await initRepoAndPush({\n dir: getRepoSourceDirectory(workspacePath, sourcePath),\n remoteUrl,\n defaultBranch,\n auth: {\n username: 'x-access-token',\n password,\n },\n logger,\n commitMessage,\n gitAuthorInfo,\n });\n\n if (protectDefaultBranch) {\n try {\n await enableBranchProtectionOnDefaultRepoBranch({\n owner,\n client,\n repoName: repo,\n logger,\n defaultBranch,\n bypassPullRequestAllowances,\n requiredApprovingReviewCount,\n restrictions,\n requireCodeOwnerReviews,\n requiredStatusCheckContexts,\n requireBranchesToBeUpToDate,\n requiredConversationResolution,\n requireLastPushApproval,\n enforceAdmins: protectEnforceAdmins,\n dismissStaleReviews: dismissStaleReviews,\n requiredCommitSigning: requiredCommitSigning,\n });\n } catch (e) {\n assertError(e);\n logger.warn(\n `Skipping: default branch protection on '${repo}', ${e.message}`,\n );\n }\n }\n\n return { commitHash: commitResult.commitHash };\n}\n\nfunction extractCollaboratorName(\n collaborator: { user: string } | { team: string } | { username: string },\n) {\n if ('username' in collaborator) return collaborator.username;\n if ('user' in collaborator) return collaborator.user;\n return collaborator.team;\n}\n\nasync function validateAccessTeam(client: Octokit, access: string) {\n const [org, team_slug] = access.split('/');\n try {\n // Below rule disabled because of a 'getByName' check for a different library\n // incorrectly triggers here.\n // eslint-disable-next-line testing-library/no-await-sync-queries\n await client.rest.teams.getByName({\n org,\n team_slug,\n });\n } catch (e) {\n if (e.response.data.message === 'Not Found') {\n const message = `Received 'Not Found' from the API; one of org:\n ${org} or team: ${team_slug} was not found within GitHub.`;\n throw new NotFoundError(message);\n }\n }\n}\n\nexport function getGitCommitMessage(\n gitCommitMessage: string | undefined,\n config: Config,\n): string | undefined {\n return gitCommitMessage\n ? gitCommitMessage\n : config.getOptionalString('scaffolder.defaultCommitMessage');\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'GitHub Action Workflow Without Inputs.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:actions:dispatch',\n name: 'Dispatch Github Action Workflow',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n workflowId: 'WORKFLOW_ID',\n branchOrTagName: 'main',\n },\n },\n ],\n }),\n },\n {\n description: 'GitHub Action Workflow With Inputs',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:actions:dispatch',\n name: 'Dispatch Github Action Workflow with inputs',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n workflowId: 'WORKFLOW_ID',\n branchOrTagName: 'main',\n workflowInputs: {\n input1: 'value1',\n input2: 'value2',\n },\n },\n },\n ],\n }),\n },\n {\n description: 'GitHub Action Workflow With Custom Token',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:actions:dispatch',\n name: 'Dispatch GitHub Action Workflow (custom token)',\n input: {\n repoUrl: 'github.com?repo=reponame&owner=owner',\n workflowId: 'WORKFLOW_ID',\n branchOrTagName: 'release-1.0',\n token: '${{ secrets.MY_CUSTOM_TOKEN }}',\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport {\n GithubCredentialsProvider,\n ScmIntegrations,\n} from '@backstage/integration';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { Octokit } from 'octokit';\nimport { getOctokitOptions } from './helpers';\nimport { examples } from './githubActionsDispatch.examples';\n\n/**\n * Creates a new action that dispatches a GitHub Action workflow for a given branch or tag.\n * @public\n */\nexport function createGithubActionsDispatchAction(options: {\n integrations: ScmIntegrations;\n githubCredentialsProvider?: GithubCredentialsProvider;\n}) {\n const { integrations, githubCredentialsProvider } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n workflowId: string;\n branchOrTagName: string;\n workflowInputs?: { [key: string]: string };\n token?: string;\n }>({\n id: 'github:actions:dispatch',\n description:\n 'Dispatches a GitHub Action workflow for a given branch or tag',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl', 'workflowId', 'branchOrTagName'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n description: `Accepts the format 'github.com?repo=reponame&owner=owner' where 'reponame' is the new repository name and 'owner' is an organization or username`,\n type: 'string',\n },\n workflowId: {\n title: 'Workflow ID',\n description: 'The GitHub Action Workflow filename',\n type: 'string',\n },\n branchOrTagName: {\n title: 'Branch or Tag name',\n description:\n 'The git branch or tag name used to dispatch the workflow',\n type: 'string',\n },\n workflowInputs: {\n title: 'Workflow Inputs',\n description:\n 'Inputs keys and values to send to GitHub Action configured on the workflow file. The maximum number of properties is 10. ',\n type: 'object',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The GITHUB_TOKEN to use for authorization to GitHub',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n workflowId,\n branchOrTagName,\n workflowInputs,\n token: providedToken,\n } = ctx.input;\n\n ctx.logger.info(\n `Dispatching workflow ${workflowId} for repo ${repoUrl} on ${branchOrTagName}`,\n );\n\n const { owner, repo } = parseRepoUrl(repoUrl, integrations);\n\n if (!owner) {\n throw new InputError('Invalid repository owner provided in repoUrl');\n }\n\n const client = new Octokit(\n await getOctokitOptions({\n integrations,\n repoUrl,\n credentialsProvider: githubCredentialsProvider,\n token: providedToken,\n }),\n );\n\n await client.rest.actions.createWorkflowDispatch({\n owner,\n repo,\n workflow_id: workflowId,\n ref: branchOrTagName,\n inputs: workflowInputs,\n });\n\n ctx.logger.info(`Workflow ${workflowId} dispatched successfully`);\n },\n });\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Add labels to pull request or issue',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:issues:label',\n name: 'Add labels to pull request or issue',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n number: '1',\n labels: ['bug'],\n },\n },\n ],\n }),\n },\n {\n description: 'Add labels to pull request or issue with specific token',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:issues:label',\n name: 'Add labels to pull request or issue with token',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n number: '1',\n labels: ['bug', 'documentation'],\n token: 'gph_YourGitHubToken',\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { assertError, InputError } from '@backstage/errors';\nimport { Octokit } from 'octokit';\nimport { getOctokitOptions } from './helpers';\nimport { examples } from './githubIssuesLabel.examples';\n\n/**\n * Adds labels to a pull request or issue on GitHub\n * @public\n */\nexport function createGithubIssuesLabelAction(options: {\n integrations: ScmIntegrationRegistry;\n githubCredentialsProvider?: GithubCredentialsProvider;\n}) {\n const { integrations, githubCredentialsProvider } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n number: number;\n labels: string[];\n token?: string;\n }>({\n id: 'github:issues:label',\n description: 'Adds labels to a pull request or issue on GitHub.',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl', 'number', 'labels'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n description: `Accepts the format 'github.com?repo=reponame&owner=owner' where 'reponame' is the repository name and 'owner' is an organization or username`,\n type: 'string',\n },\n number: {\n title: 'Pull Request or issue number',\n description: 'The pull request or issue number to add labels to',\n type: 'number',\n },\n labels: {\n title: 'Labels',\n description: 'The labels to add to the pull request or issue',\n type: 'array',\n items: {\n type: 'string',\n },\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The GITHUB_TOKEN to use for authorization to GitHub',\n },\n },\n },\n },\n async handler(ctx) {\n const { repoUrl, number, labels, token: providedToken } = ctx.input;\n\n const { owner, repo } = parseRepoUrl(repoUrl, integrations);\n ctx.logger.info(`Adding labels to ${number} issue on repo ${repo}`);\n\n if (!owner) {\n throw new InputError('Invalid repository owner provided in repoUrl');\n }\n\n const client = new Octokit(\n await getOctokitOptions({\n integrations,\n credentialsProvider: githubCredentialsProvider,\n repoUrl: repoUrl,\n token: providedToken,\n }),\n );\n\n try {\n await client.rest.issues.addLabels({\n owner,\n repo,\n issue_number: number,\n labels,\n });\n } catch (e) {\n assertError(e);\n ctx.logger.warn(\n `Failed: adding labels to issue: '${number}' on repo: '${repo}', ${e.message}`,\n );\n }\n },\n });\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst repoUrl = {\n title: 'Repository Location',\n description: `Accepts the format 'github.com?repo=reponame&owner=owner' where 'reponame' is the new repository name and 'owner' is an organization or username`,\n type: 'string',\n};\nconst description = {\n title: 'Repository Description',\n type: 'string',\n};\nconst homepage = {\n title: 'Repository Homepage',\n type: 'string',\n};\nconst access = {\n title: 'Repository Access',\n description: `Sets an admin collaborator on the repository. Can either be a user reference different from 'owner' in 'repoUrl' or team reference, eg. 'org/team-name'`,\n type: 'string',\n};\nconst requireCodeOwnerReviews = {\n title: 'Require CODEOWNER Reviews?',\n description:\n 'Require an approved review in PR including files with a designated Code Owner',\n type: 'boolean',\n};\nconst dismissStaleReviews = {\n title: 'Dismiss Stale Reviews',\n description:\n 'New reviewable commits pushed to a matching branch will dismiss pull request review approvals.',\n type: 'boolean',\n};\nconst requiredStatusCheckContexts = {\n title: 'Required Status Check Contexts',\n description:\n 'The list of status checks to require in order to merge into this branch',\n type: 'array',\n items: {\n type: 'string',\n },\n};\nconst requireBranchesToBeUpToDate = {\n title: 'Require Branches To Be Up To Date?',\n description: `Require branches to be up to date before merging. The default value is 'true'`,\n type: 'boolean',\n};\nconst requiredConversationResolution = {\n title: 'Required Conversation Resolution',\n description:\n 'Requires all conversations on code to be resolved before a pull request can be merged into this branch',\n type: 'boolean',\n};\nconst requireLastPushApproval = {\n title: 'Require last push approval',\n type: 'boolean',\n description: `Whether the most recent push to a PR must be approved by someone other than the person who pushed it. The default value is 'false'`,\n};\nconst repoVisibility = {\n title: 'Repository Visibility',\n type: 'string',\n enum: ['private', 'public', 'internal'],\n};\nconst deleteBranchOnMerge = {\n title: 'Delete Branch On Merge',\n type: 'boolean',\n description: `Delete the branch after merging the PR. The default value is 'false'`,\n};\nconst gitAuthorName = {\n title: 'Default Author Name',\n type: 'string',\n description: `Sets the default author name for the commit. The default value is 'Scaffolder'`,\n};\nconst gitAuthorEmail = {\n title: 'Default Author Email',\n type: 'string',\n description: `Sets the default author email for the commit.`,\n};\nconst allowMergeCommit = {\n title: 'Allow Merge Commits',\n type: 'boolean',\n description: `Allow merge commits. The default value is 'true'`,\n};\nconst allowSquashMerge = {\n title: 'Allow Squash Merges',\n type: 'boolean',\n description: `Allow squash merges. The default value is 'true'`,\n};\nconst squashMergeCommitTitle = {\n title: 'Default squash merge commit title',\n enum: ['PR_TITLE', 'COMMIT_OR_PR_TITLE'],\n description: `Sets the default value for a squash merge commit title. The default value is 'COMMIT_OR_PR_TITLE'`,\n};\nconst squashMergeCommitMessage = {\n title: 'Default squash merge commit message',\n enum: ['PR_BODY', 'COMMIT_MESSAGES', 'BLANK'],\n description: `Sets the default value for a squash merge commit message. The default value is 'COMMIT_MESSAGES'`,\n};\n\nconst allowRebaseMerge = {\n title: 'Allow Rebase Merges',\n type: 'boolean',\n description: `Allow rebase merges. The default value is 'true'`,\n};\nconst allowAutoMerge = {\n title: 'Allow Auto Merges',\n type: 'boolean',\n description: `Allow individual PRs to merge automatically when all merge requirements are met. The default value is 'false'`,\n};\nconst collaborators = {\n title: 'Collaborators',\n description: 'Provide additional users or teams with permissions',\n type: 'array',\n items: {\n type: 'object',\n additionalProperties: false,\n required: ['access'],\n properties: {\n access: {\n type: 'string',\n description: 'The type of access for the user',\n },\n user: {\n type: 'string',\n description:\n 'The name of the user that will be added as a collaborator',\n },\n team: {\n type: 'string',\n description:\n 'The name of the team that will be added as a collaborator',\n },\n },\n oneOf: [{ required: ['user'] }, { required: ['team'] }],\n },\n};\nconst hasProjects = {\n title: 'Enable projects',\n type: 'boolean',\n description: `Enable projects for the repository. The default value is 'true' unless the organization has disabled repository projects`,\n};\nconst hasWiki = {\n title: 'Enable the wiki',\n type: 'boolean',\n description: `Enable the wiki for the repository. The default value is 'true'`,\n};\nconst hasIssues = {\n title: 'Enable issues',\n type: 'boolean',\n description: `Enable issues for the repository. The default value is 'true'`,\n};\nconst token = {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to GitHub',\n};\nconst topics = {\n title: 'Topics',\n type: 'array',\n items: {\n type: 'string',\n },\n};\nconst defaultBranch = {\n title: 'Default Branch',\n type: 'string',\n description: `Sets the default branch on the repository. The default value is 'master'`,\n};\nconst protectDefaultBranch = {\n title: 'Protect Default Branch',\n type: 'boolean',\n description: `Protect the default branch after creating the repository. The default value is 'true'`,\n};\nconst protectEnforceAdmins = {\n title: 'Enforce Admins On Protected Branches',\n type: 'boolean',\n description: `Enforce admins to adhere to default branch protection. The default value is 'true'`,\n};\n\nconst bypassPullRequestAllowances = {\n title: 'Bypass pull request requirements',\n description:\n 'Allow specific users, teams, or apps to bypass pull request requirements.',\n type: 'object',\n additionalProperties: false,\n properties: {\n apps: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n users: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n teams: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n },\n};\n\nconst gitCommitMessage = {\n title: 'Git Commit Message',\n type: 'string',\n description: `Sets the commit message on the repository. The default value is 'initial commit'`,\n};\nconst sourcePath = {\n title: 'Source Path',\n description:\n 'Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.',\n type: 'string',\n};\n\nconst requiredApprovingReviewCount = {\n title: 'Required approving review count',\n type: 'number',\n description: `Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. Defaults to 1.`,\n};\n\nconst restrictions = {\n title: 'Restrict who can push to the protected branch',\n description:\n 'Restrict who can push to the protected branch. User, app, and team restrictions are only available for organization-owned repositories.',\n type: 'object',\n additionalProperties: false,\n properties: {\n apps: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n users: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n teams: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n },\n};\n\nconst requiredCommitSigning = {\n title: 'Require commit signing',\n type: 'boolean',\n description: `Require commit signing so that you must sign commits on this branch.`,\n};\n\nconst repoVariables = {\n title: 'Repository Variables',\n description: `Variables attached to the repository`,\n type: 'object',\n};\n\nconst secrets = {\n title: 'Repository Secrets',\n description: `Secrets attached to the repository`,\n type: 'object',\n};\n\nconst oidcCustomization = {\n title: 'Repository OIDC customization template',\n description: `OIDC customization template attached to the repository.`,\n type: 'object',\n additionalProperties: false,\n properties: {\n useDefault: {\n title: 'Use Default',\n type: 'boolean',\n description: `Whether to use the default OIDC template or not.`,\n },\n includeClaimKeys: {\n title: 'Include claim keys',\n type: 'array',\n items: {\n type: 'string',\n },\n description: `Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.`,\n },\n },\n};\n\nconst customProperties = {\n title: 'Custom Repository Properties',\n description:\n 'Custom properties to be added to the repository (note, this only works for organization repositories)',\n type: 'object',\n};\n\nexport { access };\nexport { allowMergeCommit };\nexport { allowRebaseMerge };\nexport { allowSquashMerge };\nexport { squashMergeCommitTitle };\nexport { squashMergeCommitMessage };\nexport { allowAutoMerge };\nexport { collaborators };\nexport { defaultBranch };\nexport { deleteBranchOnMerge };\nexport { description };\nexport { gitAuthorEmail };\nexport { gitAuthorName };\nexport { gitCommitMessage };\nexport { homepage };\nexport { protectDefaultBranch };\nexport { protectEnforceAdmins };\nexport { bypassPullRequestAllowances };\nexport { requiredApprovingReviewCount };\nexport { restrictions };\nexport { repoUrl };\nexport { repoVisibility };\nexport { requireCodeOwnerReviews };\nexport { dismissStaleReviews };\nexport { requiredStatusCheckContexts };\nexport { requireBranchesToBeUpToDate };\nexport { requiredConversationResolution };\nexport { requireLastPushApproval };\nexport { hasProjects };\nexport { hasIssues };\nexport { hasWiki };\nexport { sourcePath };\nexport { token };\nexport { topics };\nexport { requiredCommitSigning };\nexport { repoVariables };\nexport { secrets };\nexport { oidcCustomization };\nexport { customProperties };\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst remoteUrl = {\n title: 'A URL to the repository with the provider',\n type: 'string',\n};\nconst repoContentsUrl = {\n title: 'A URL to the root of the repository',\n type: 'string',\n};\n\nconst commitHash = {\n title: 'The git commit hash of the initial commit',\n type: 'string',\n};\n\nexport { remoteUrl };\nexport { repoContentsUrl };\nexport { commitHash };\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Creates a GitHub repository with default configuration.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n },\n },\n ],\n }),\n },\n {\n description: 'Add a description.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with a description',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n description: 'My new repository',\n },\n },\n ],\n }),\n },\n {\n description: 'Disable wiki and issues.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository without wiki and issues',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n hasIssues: false,\n hasWiki: false,\n },\n },\n ],\n }),\n },\n {\n description: 'Set repository homepage.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with homepage',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n homepage: 'https://example.com',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a private repository.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new private GitHub repository',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n repoVisibility: 'private',\n },\n },\n ],\n }),\n },\n {\n description: 'Enable required code owner reviews.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with required code owner reviews',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requireCodeOwnerReviews: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Set required approving review count to 2.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with required approving review count',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requiredApprovingReviewCount: 2,\n },\n },\n ],\n }),\n },\n {\n description: 'Allow squash merge only.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository allowing only squash merge',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n allowMergeCommit: false,\n allowSquashMerge: true,\n allowRebaseMerge: false,\n },\n },\n ],\n }),\n },\n {\n description: 'Set squash merge commit title to pull request title.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with squash merge commit title set to pull request title',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n squashMergeCommitTitle: 'pull_request_title',\n },\n },\n ],\n }),\n },\n {\n description: 'Set squash merge commit message to blank.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with squash merge commit message set to blank',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n squashMergeCommitMessage: 'blank',\n },\n },\n ],\n }),\n },\n {\n description: 'Allow auto-merge.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository allowing auto-merge',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n allowAutoMerge: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Set collaborators with push access.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with collaborators having push access',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n collaborators: [\n { username: 'user1', permission: 'push' },\n { username: 'user2', permission: 'push' },\n ],\n },\n },\n ],\n }),\n },\n {\n description: 'Add topics to repository.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with topics',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n topics: ['devops', 'kubernetes', 'ci-cd'],\n },\n },\n ],\n }),\n },\n {\n description: 'Add secret variables to repository.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with secret variables',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n secrets: [\n { name: 'SECRET_KEY', value: 'supersecretkey' },\n { name: 'API_TOKEN', value: 'tokenvalue' },\n ],\n },\n },\n ],\n }),\n },\n {\n description: 'Enable branch protection requiring status checks.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with branch protection requiring status checks',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requiredStatusCheckContexts: ['ci/circleci: build'],\n },\n },\n ],\n }),\n },\n {\n description: 'Require branches to be up-to-date before merging.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository requiring branches to be up-to-date before merging',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requireBranchesToBeUpToDate: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Require conversation resolution before merging.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository requiring conversation resolution before merging',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requiredConversationResolution: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Delete branch on merge.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with branch deletion on merge',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n deleteBranchOnMerge: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Customize OIDC token.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with OIDC token customization',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n oidcCustomization: {\n sub: 'repo:owner/repo',\n aud: 'https://github.com',\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Require commit signing.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository requiring commit signing',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requiredCommitSigning: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Set multiple properties including description, homepage, and visibility.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with multiple properties',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n description: 'A repository for project XYZ',\n homepage: 'https://project-xyz.com',\n repoVisibility: 'internal',\n },\n },\n ],\n }),\n },\n {\n description: 'Configure branch protection with multiple settings.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with branch protection settings',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requiredStatusCheckContexts: [\n 'ci/circleci: build',\n 'ci/circleci: test',\n ],\n requireBranchesToBeUpToDate: true,\n requiredConversationResolution: true,\n requiredApprovingReviewCount: 2,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Set repository access to private and add collaborators with admin access.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new private GitHub repository with collaborators',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n repoVisibility: 'private',\n collaborators: [\n { username: 'admin1', permission: 'admin' },\n { username: 'admin2', permission: 'admin' },\n ],\n },\n },\n ],\n }),\n },\n {\n description: 'Enable GitHub Projects for the repository.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with GitHub Projects enabled',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n hasProjects: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Disable merge commits and allow only rebase and squash merges.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository allowing only rebase and squash merges',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n allowMergeCommit: false,\n allowRebaseMerge: true,\n allowSquashMerge: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Set repository access to internal with no projects and issues.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new internal GitHub repository without projects and issues',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n repoVisibility: 'internal',\n hasProjects: false,\n hasIssues: false,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create repository with OIDC customization for specific audience.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with OIDC customization for specific audience',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n oidcCustomization: {\n sub: 'repo:owner/repo',\n aud: 'https://specific-audience.com',\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Require all branches to be up-to-date before merging.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository requiring all branches to be up-to-date',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requireBranchesToBeUpToDate: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Set description and topics for the repository.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with description and topics',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n description: 'Repository for project ABC',\n topics: ['python', 'machine-learning', 'data-science'],\n },\n },\n ],\n }),\n },\n {\n description:\n 'Set repository visibility to public and enable commit signing.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new public GitHub repository with commit signing required',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n repoVisibility: 'public',\n requiredCommitSigning: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a repository with collaborators and default branch protection.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with collaborators and branch protection',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n collaborators: [\n { username: 'contributor1', permission: 'write' },\n { username: 'contributor2', permission: 'write' },\n ],\n requiredStatusCheckContexts: ['ci/travis: build'],\n },\n },\n ],\n }),\n },\n {\n description: 'Add multiple secret variables.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with multiple secret variables',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n secrets: [\n { name: 'SECRET_KEY_1', value: 'value1' },\n { name: 'SECRET_KEY_2', value: 'value2' },\n ],\n },\n },\n ],\n }),\n },\n {\n description: 'Require a minimum of 2 approving reviews for merging.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with 2 required approving reviews',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requiredApprovingReviewCount: 2,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enable branch protection with conversation resolution required.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with branch protection and conversation resolution required',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requiredConversationResolution: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Set repository visibility to internal with description and homepage.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new internal GitHub repository with description and homepage',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n repoVisibility: 'internal',\n description: 'Internal repository for team collaboration',\n homepage: 'https://internal.example.com',\n },\n },\n ],\n }),\n },\n {\n description: 'Disable auto-merge.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with auto-merge disabled',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n allowAutoMerge: false,\n },\n },\n ],\n }),\n },\n {\n description: 'Set repository topics and enable GitHub Projects.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with topics and GitHub Projects enabled',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n topics: ['opensource', 'nodejs', 'api'],\n hasProjects: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a private repository with collaborators having admin and write access.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new private GitHub repository with multiple collaborators',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n repoVisibility: 'private',\n collaborators: [\n { username: 'admin1', permission: 'admin' },\n { username: 'writer1', permission: 'write' },\n ],\n },\n },\n ],\n }),\n },\n {\n description: 'Disable branch deletion on merge.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with branch deletion on merge disabled',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n deleteBranchOnMerge: false,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Set repository visibility to internal and enable commit signing.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new internal GitHub repository with commit signing required',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n repoVisibility: 'internal',\n requiredCommitSigning: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create repository with description, homepage, and required status checks.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with description, homepage, and status checks',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n description: 'Repository for web application project',\n homepage: 'https://webapp.example.com',\n requiredStatusCheckContexts: [\n 'ci/travis: build',\n 'ci/travis: lint',\n ],\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enable squash merges only and set commit message to pull request description.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository allowing only squash merges with commit message set to pull request description',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n allowMergeCommit: false,\n allowSquashMerge: true,\n allowRebaseMerge: false,\n squashMergeCommitMessage: 'pull_request_description',\n },\n },\n ],\n }),\n },\n {\n description: 'Enable rebase merges only and require commit signing.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository allowing only rebase merges with commit signing required',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n allowMergeCommit: false,\n allowRebaseMerge: true,\n allowSquashMerge: false,\n requiredCommitSigning: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create repository with OIDC customization for multiple audiences.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with OIDC customization for multiple audiences',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n oidcCustomization: {\n sub: 'repo:owner/repo',\n aud: ['https://audience1.com', 'https://audience2.com'],\n },\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enable branch protection with required approving reviews and status checks.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with branch protection requiring approving reviews and status checks',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requiredApprovingReviewCount: 2,\n requiredStatusCheckContexts: [\n 'ci/circleci: build',\n 'ci/circleci: test',\n ],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a public repository with topics and secret variables.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new public GitHub repository with topics and secret variables',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n repoVisibility: 'public',\n topics: ['javascript', 'react', 'frontend'],\n secrets: [\n { name: 'API_KEY', value: 'apikeyvalue' },\n { name: 'DB_PASSWORD', value: 'dbpasswordvalue' },\n ],\n },\n },\n ],\n }),\n },\n {\n description: 'Set repository description and disable issues and wiki.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with description, and disable issues and wiki',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n description: 'Repository for backend service',\n hasIssues: false,\n hasWiki: false,\n },\n },\n ],\n }),\n },\n {\n description: 'Enable required conversation resolution and commit signing.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with required conversation resolution and commit signing',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requiredConversationResolution: true,\n requiredCommitSigning: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Set repository visibility to private and require branches to be up-to-date.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new private GitHub repository requiring branches to be up-to-date',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n repoVisibility: 'private',\n requireBranchesToBeUpToDate: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a repository with default settings and add multiple topics.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with default settings and topics',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n topics: ['devops', 'ci-cd', 'automation'],\n },\n },\n ],\n }),\n },\n {\n description:\n 'Disable merge commits, enable auto-merge, and require commit signing.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository disabling merge commits, enabling auto-merge, and requiring commit signing',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n allowMergeCommit: false,\n allowAutoMerge: true,\n requiredCommitSigning: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a repository with homepage, collaborators, and topics.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with homepage, collaborators, and topics',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n homepage: 'https://example.com',\n collaborators: [\n { username: 'user1', permission: 'push' },\n { username: 'user2', permission: 'admin' },\n ],\n topics: ['opensource', 'contribution'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a repository with branch protection and description.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with branch protection and description',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requiredStatusCheckContexts: ['ci/travis: build'],\n requiredApprovingReviewCount: 1,\n description: 'Repository for microservice development',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a repository with OIDC customization and topics.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with OIDC customization and topics',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n oidcCustomization: {\n sub: 'repo:owner/repo',\n aud: 'https://api.example.com',\n },\n topics: ['api', 'security'],\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enable required code owner reviews and branch deletion on merge.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with required code owner reviews and branch deletion on merge',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requireCodeOwnerReviews: true,\n deleteBranchOnMerge: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a repository with multiple secret variables and collaborators.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with multiple secret variables and collaborators',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n secrets: [\n { name: 'API_SECRET', value: 'secretvalue' },\n { name: 'DB_USER', value: 'dbuser' },\n ],\n collaborators: [\n { username: 'dev1', permission: 'write' },\n { username: 'dev2', permission: 'push' },\n ],\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enable branch protection requiring status checks and conversation resolution.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with branch protection requiring status checks and conversation resolution',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n requiredStatusCheckContexts: ['ci/build'],\n requiredConversationResolution: true,\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport {\n GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport { Octokit } from 'octokit';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport {\n createGithubRepoWithCollaboratorsAndTopics,\n getOctokitOptions,\n} from './helpers';\nimport * as inputProps from './inputProperties';\nimport * as outputProps from './outputProperties';\nimport { examples } from './githubRepoCreate.examples';\n\n/**\n * Creates a new action that initializes a git repository\n *\n * @public\n */\nexport function createGithubRepoCreateAction(options: {\n integrations: ScmIntegrationRegistry;\n githubCredentialsProvider?: GithubCredentialsProvider;\n}) {\n const { integrations, githubCredentialsProvider } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n description?: string;\n homepage?: string;\n access?: string;\n deleteBranchOnMerge?: boolean;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n allowRebaseMerge?: boolean;\n allowSquashMerge?: boolean;\n squashMergeCommitTitle?: 'PR_TITLE' | 'COMMIT_OR_PR_TITLE';\n squashMergeCommitMessage?: 'PR_BODY' | 'COMMIT_MESSAGES' | 'BLANK';\n allowMergeCommit?: boolean;\n allowAutoMerge?: boolean;\n requireCodeOwnerReviews?: boolean;\n bypassPullRequestAllowances?: {\n users?: string[];\n teams?: string[];\n apps?: string[];\n };\n requiredApprovingReviewCount?: number;\n restrictions?: {\n users: string[];\n teams: string[];\n apps?: string[];\n };\n requiredStatusCheckContexts?: string[];\n requireBranchesToBeUpToDate?: boolean;\n requiredConversationResolution?: boolean;\n repoVisibility?: 'private' | 'internal' | 'public';\n collaborators?: Array<\n | {\n user: string;\n access: string;\n }\n | {\n team: string;\n access: string;\n }\n | {\n /** @deprecated This field is deprecated in favor of team */\n username: string;\n access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';\n }\n >;\n hasProjects?: boolean;\n hasWiki?: boolean;\n hasIssues?: boolean;\n token?: string;\n topics?: string[];\n repoVariables?: { [key: string]: string };\n secrets?: { [key: string]: string };\n oidcCustomization?: {\n useDefault: boolean;\n includeClaimKeys?: string[];\n };\n requireCommitSigning?: boolean;\n customProperties?: { [key: string]: string };\n }>({\n id: 'github:repo:create',\n description: 'Creates a GitHub repository.',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl'],\n properties: {\n repoUrl: inputProps.repoUrl,\n description: inputProps.description,\n homepage: inputProps.homepage,\n access: inputProps.access,\n requireCodeOwnerReviews: inputProps.requireCodeOwnerReviews,\n bypassPullRequestAllowances: inputProps.bypassPullRequestAllowances,\n requiredApprovingReviewCount: inputProps.requiredApprovingReviewCount,\n restrictions: inputProps.restrictions,\n requiredStatusCheckContexts: inputProps.requiredStatusCheckContexts,\n requireBranchesToBeUpToDate: inputProps.requireBranchesToBeUpToDate,\n requiredConversationResolution:\n inputProps.requiredConversationResolution,\n repoVisibility: inputProps.repoVisibility,\n deleteBranchOnMerge: inputProps.deleteBranchOnMerge,\n allowMergeCommit: inputProps.allowMergeCommit,\n allowSquashMerge: inputProps.allowSquashMerge,\n squashMergeCommitTitle: inputProps.squashMergeCommitTitle,\n squashMergeCommitMessage: inputProps.squashMergeCommitMessage,\n allowRebaseMerge: inputProps.allowRebaseMerge,\n allowAutoMerge: inputProps.allowAutoMerge,\n collaborators: inputProps.collaborators,\n hasProjects: inputProps.hasProjects,\n hasWiki: inputProps.hasWiki,\n hasIssues: inputProps.hasIssues,\n token: inputProps.token,\n topics: inputProps.topics,\n repoVariables: inputProps.repoVariables,\n secrets: inputProps.secrets,\n oidcCustomization: inputProps.oidcCustomization,\n requiredCommitSigning: inputProps.requiredCommitSigning,\n customProperties: inputProps.customProperties,\n },\n },\n output: {\n type: 'object',\n properties: {\n remoteUrl: outputProps.remoteUrl,\n repoContentsUrl: outputProps.repoContentsUrl,\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n description,\n homepage,\n access,\n repoVisibility = 'private',\n deleteBranchOnMerge = false,\n allowMergeCommit = true,\n allowSquashMerge = true,\n squashMergeCommitTitle = 'COMMIT_OR_PR_TITLE',\n squashMergeCommitMessage = 'COMMIT_MESSAGES',\n allowRebaseMerge = true,\n allowAutoMerge = false,\n collaborators,\n hasProjects = undefined,\n hasWiki = undefined,\n hasIssues = undefined,\n topics,\n repoVariables,\n secrets,\n oidcCustomization,\n customProperties,\n token: providedToken,\n } = ctx.input;\n\n const octokitOptions = await getOctokitOptions({\n integrations,\n credentialsProvider: githubCredentialsProvider,\n token: providedToken,\n repoUrl: repoUrl,\n });\n const client = new Octokit(octokitOptions);\n\n const { owner, repo } = parseRepoUrl(repoUrl, integrations);\n\n if (!owner) {\n throw new InputError('Invalid repository owner provided in repoUrl');\n }\n\n const newRepo = await createGithubRepoWithCollaboratorsAndTopics(\n client,\n repo,\n owner,\n repoVisibility,\n description,\n homepage,\n deleteBranchOnMerge,\n allowMergeCommit,\n allowSquashMerge,\n squashMergeCommitTitle,\n squashMergeCommitMessage,\n allowRebaseMerge,\n allowAutoMerge,\n access,\n collaborators,\n hasProjects,\n hasWiki,\n hasIssues,\n topics,\n repoVariables,\n secrets,\n oidcCustomization,\n customProperties,\n ctx.logger,\n );\n\n ctx.output('remoteUrl', newRepo.clone_url);\n },\n });\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Setup repo with no modifications to branch protection rules',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:push',\n name: 'Create test repo with testuser as owner.',\n input: {\n repoUrl: 'github.com?repo=test&owner=testuser',\n },\n },\n ],\n }),\n },\n {\n description: 'Setup repo with required codeowners check',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:push',\n name: 'Require codeowner branch protection rule',\n input: {\n repoUrl: 'github.com?repo=reponame&owner=owner',\n requireCodeOwnerReviews: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Change the default required number of approvals',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:push',\n name: 'Require two approvals before merging',\n input: {\n repoUrl: 'github.com?repo=reponame&owner=owner',\n requiredApprovingReviewCount: 2,\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config } from '@backstage/config';\nimport { InputError } from '@backstage/errors';\nimport {\n GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport { Octokit } from 'octokit';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { getOctokitOptions, initRepoPushAndProtect } from './helpers';\nimport * as inputProps from './inputProperties';\nimport * as outputProps from './outputProperties';\nimport { examples } from './githubRepoPush.examples';\n\n/**\n * Creates a new action that initializes a git repository of the content in the workspace\n * and publishes it to GitHub.\n *\n * @public\n */\nexport function createGithubRepoPushAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n githubCredentialsProvider?: GithubCredentialsProvider;\n}) {\n const { integrations, config, githubCredentialsProvider } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n description?: string;\n defaultBranch?: string;\n protectDefaultBranch?: boolean;\n protectEnforceAdmins?: boolean;\n gitCommitMessage?: string;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n requireCodeOwnerReviews?: boolean;\n dismissStaleReviews?: boolean;\n bypassPullRequestAllowances?:\n | {\n users?: string[];\n teams?: string[];\n apps?: string[];\n }\n | undefined;\n requiredApprovingReviewCount?: number;\n restrictions?:\n | {\n users: string[];\n teams: string[];\n apps?: string[];\n }\n | undefined;\n requiredStatusCheckContexts?: string[];\n requireBranchesToBeUpToDate?: boolean;\n requiredConversationResolution?: boolean;\n sourcePath?: string;\n token?: string;\n requiredCommitSigning?: boolean;\n requireLastPushApproval?: boolean;\n }>({\n id: 'github:repo:push',\n description:\n 'Initializes a git repository of contents in workspace and publishes it to GitHub.',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl'],\n properties: {\n repoUrl: inputProps.repoUrl,\n requireCodeOwnerReviews: inputProps.requireCodeOwnerReviews,\n dismissStaleReviews: inputProps.dismissStaleReviews,\n requiredStatusCheckContexts: inputProps.requiredStatusCheckContexts,\n bypassPullRequestAllowances: inputProps.bypassPullRequestAllowances,\n requiredApprovingReviewCount: inputProps.requiredApprovingReviewCount,\n restrictions: inputProps.restrictions,\n requireBranchesToBeUpToDate: inputProps.requireBranchesToBeUpToDate,\n requiredConversationResolution:\n inputProps.requiredConversationResolution,\n requireLastPushApproval: inputProps.requireLastPushApproval,\n defaultBranch: inputProps.defaultBranch,\n protectDefaultBranch: inputProps.protectDefaultBranch,\n protectEnforceAdmins: inputProps.protectEnforceAdmins,\n gitCommitMessage: inputProps.gitCommitMessage,\n gitAuthorName: inputProps.gitAuthorName,\n gitAuthorEmail: inputProps.gitAuthorEmail,\n sourcePath: inputProps.sourcePath,\n token: inputProps.token,\n requiredCommitSigning: inputProps.requiredCommitSigning,\n },\n },\n output: {\n type: 'object',\n properties: {\n remoteUrl: outputProps.remoteUrl,\n repoContentsUrl: outputProps.repoContentsUrl,\n commitHash: outputProps.commitHash,\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n defaultBranch = 'master',\n protectDefaultBranch = true,\n protectEnforceAdmins = true,\n gitCommitMessage = 'initial commit',\n gitAuthorName,\n gitAuthorEmail,\n requireCodeOwnerReviews = false,\n dismissStaleReviews = false,\n bypassPullRequestAllowances,\n requiredApprovingReviewCount = 1,\n restrictions,\n requiredStatusCheckContexts = [],\n requireBranchesToBeUpToDate = true,\n requiredConversationResolution = false,\n requireLastPushApproval = false,\n token: providedToken,\n requiredCommitSigning = false,\n } = ctx.input;\n\n const { owner, repo } = parseRepoUrl(repoUrl, integrations);\n\n if (!owner) {\n throw new InputError('Invalid repository owner provided in repoUrl');\n }\n\n const octokitOptions = await getOctokitOptions({\n integrations,\n credentialsProvider: githubCredentialsProvider,\n token: providedToken,\n repoUrl,\n });\n\n const client = new Octokit(octokitOptions);\n\n const targetRepo = await client.rest.repos.get({ owner, repo });\n\n const remoteUrl = targetRepo.data.clone_url;\n const repoContentsUrl = `${targetRepo.data.html_url}/blob/${defaultBranch}`;\n\n const { commitHash } = await initRepoPushAndProtect(\n remoteUrl,\n octokitOptions.auth,\n ctx.workspacePath,\n ctx.input.sourcePath,\n defaultBranch,\n protectDefaultBranch,\n protectEnforceAdmins,\n owner,\n client,\n repo,\n requireCodeOwnerReviews,\n bypassPullRequestAllowances,\n requiredApprovingReviewCount,\n restrictions,\n requiredStatusCheckContexts,\n requireBranchesToBeUpToDate,\n requiredConversationResolution,\n requireLastPushApproval,\n config,\n ctx.logger,\n gitCommitMessage,\n gitAuthorName,\n gitAuthorEmail,\n dismissStaleReviews,\n requiredCommitSigning,\n );\n\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n ctx.output('commitHash', commitHash);\n },\n });\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Create a GitHub webhook for a repository',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:webhook',\n name: 'Create GitHub Webhook',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n webhookUrl: 'https://example.com/my-webhook',\n webhookSecret: 'mysecret',\n events: ['push'],\n active: true,\n contentType: 'json',\n insecureSsl: false,\n token: 'my-github-token',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub webhook with minimal configuration',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:webhook',\n name: 'Create GitHub Webhook',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n webhookUrl: 'https://example.com/my-webhook',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub webhook with custom events',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:webhook',\n name: 'Create GitHub Webhook',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n webhookUrl: 'https://example.com/my-webhook',\n events: ['push', 'pull_request'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub webhook with JSON content type',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:webhook',\n name: 'Create GitHub Webhook',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n webhookUrl: 'https://example.com/my-webhook',\n contentType: 'json',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub webhook with insecure SSL',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:webhook',\n name: 'Create GitHub Webhook',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n webhookUrl: 'https://example.com/my-webhook',\n insecureSsl: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Create an inactive GitHub webhook',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:webhook',\n name: 'Create GitHub Webhook',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n webhookUrl: 'https://example.com/my-webhook',\n active: false,\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { emitterEventNames } from '@octokit/webhooks';\nimport { assertError, InputError } from '@backstage/errors';\nimport { Octokit } from 'octokit';\nimport { getOctokitOptions } from './helpers';\nimport { examples } from './githubWebhook.examples';\n\n/**\n * Creates new action that creates a webhook for a repository on GitHub.\n * @public\n */\nexport function createGithubWebhookAction(options: {\n integrations: ScmIntegrationRegistry;\n defaultWebhookSecret?: string;\n githubCredentialsProvider?: GithubCredentialsProvider;\n}) {\n const { integrations, defaultWebhookSecret, githubCredentialsProvider } =\n options;\n\n const eventNames = emitterEventNames.filter(event => !event.includes('.'));\n\n return createTemplateAction<{\n repoUrl: string;\n webhookUrl: string;\n webhookSecret?: string;\n events?: string[];\n active?: boolean;\n contentType?: 'form' | 'json';\n insecureSsl?: boolean;\n token?: string;\n }>({\n id: 'github:webhook',\n description: 'Creates webhook for a repository on GitHub.',\n examples,\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl', 'webhookUrl'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n description: `Accepts the format 'github.com?repo=reponame&owner=owner' where 'reponame' is the new repository name and 'owner' is an organization or username`,\n type: 'string',\n },\n webhookUrl: {\n title: 'Webhook URL',\n description: 'The URL to which the payloads will be delivered',\n type: 'string',\n },\n webhookSecret: {\n title: 'Webhook Secret',\n description:\n 'Webhook secret value. The default can be provided internally in action creation',\n type: 'string',\n },\n events: {\n title: 'Triggering Events',\n description:\n 'Determines what events the hook is triggered for. Default: push',\n type: 'array',\n oneOf: [\n {\n items: {\n type: 'string',\n enum: eventNames,\n },\n },\n {\n items: {\n type: 'string',\n const: '*',\n },\n },\n ],\n },\n active: {\n title: 'Active',\n type: 'boolean',\n description: `Determines if notifications are sent when the webhook is triggered. Default: true`,\n },\n contentType: {\n title: 'Content Type',\n type: 'string',\n enum: ['form', 'json'],\n description: `The media type used to serialize the payloads. The default is 'form'`,\n },\n insecureSsl: {\n title: 'Insecure SSL',\n type: 'boolean',\n description: `Determines whether the SSL certificate of the host for url will be verified when delivering payloads. Default 'false'`,\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The GITHUB_TOKEN to use for authorization to GitHub',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n webhookUrl,\n webhookSecret = defaultWebhookSecret,\n events = ['push'],\n active = true,\n contentType = 'form',\n insecureSsl = false,\n token: providedToken,\n } = ctx.input;\n\n ctx.logger.info(`Creating webhook ${webhookUrl} for repo ${repoUrl}`);\n const { owner, repo } = parseRepoUrl(repoUrl, integrations);\n\n if (!owner) {\n throw new InputError('Invalid repository owner provided in repoUrl');\n }\n\n const client = new Octokit(\n await getOctokitOptions({\n integrations,\n credentialsProvider: githubCredentialsProvider,\n repoUrl: repoUrl,\n token: providedToken,\n }),\n );\n\n // If this is a dry run, log and return\n if (ctx.isDryRun) {\n ctx.logger.info(`Dry run complete`);\n return;\n }\n\n try {\n const insecure_ssl = insecureSsl ? '1' : '0';\n await client.rest.repos.createWebhook({\n owner,\n repo,\n config: {\n url: webhookUrl,\n content_type: contentType,\n secret: webhookSecret,\n insecure_ssl,\n },\n events,\n active,\n });\n ctx.logger.info(`Webhook '${webhookUrl}' created successfully`);\n } catch (e) {\n assertError(e);\n ctx.logger.warn(\n `Failed: create webhook '${webhookUrl}' on repo: '${repo}', ${e.message}`,\n );\n }\n },\n });\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Example 1: Create and store a Deploy Key',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:deployKey:create',\n name: 'Create and store a Deploy Key',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n publicKey: 'pubkey',\n privateKey: 'privkey',\n deployKeyName: 'Push Tags',\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { getOctokitOptions } from './helpers';\nimport { Octokit } from 'octokit';\nimport Sodium from 'libsodium-wrappers';\nimport { examples } from './githubDeployKey.examples';\n\n/**\n * Creates an `github:deployKey:create` Scaffolder action that creates a Deploy Key\n *\n * @public\n */\nexport function createGithubDeployKeyAction(options: {\n integrations: ScmIntegrationRegistry;\n}) {\n const { integrations } = options;\n // For more information on how to define custom actions, see\n // https://backstage.io/docs/features/software-templates/writing-custom-actions\n return createTemplateAction<{\n repoUrl: string;\n publicKey: string;\n privateKey: string;\n deployKeyName: string;\n privateKeySecretName?: string;\n token?: string;\n }>({\n id: 'github:deployKey:create',\n description: 'Creates and stores Deploy Keys',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl', 'publicKey', 'privateKey', 'deployKeyName'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n description: `Accepts the format 'github.com?repo=reponame&owner=owner' where 'reponame' is the new repository name and 'owner' is an organization or username`,\n type: 'string',\n },\n publicKey: {\n title: 'SSH Public Key',\n description: `Generated from ssh-keygen. Begins with 'ssh-rsa', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', 'ecdsa-sha2-nistp521', 'ssh-ed25519', 'sk-ecdsa-sha2-nistp256@openssh.com', or 'sk-ssh-ed25519@openssh.com'.`,\n type: 'string',\n },\n privateKey: {\n title: 'SSH Private Key',\n description: `SSH Private Key generated from ssh-keygen`,\n type: 'string',\n },\n deployKeyName: {\n title: 'Deploy Key Name',\n description: `Name of the Deploy Key`,\n type: 'string',\n },\n privateKeySecretName: {\n title: 'Private Key GitHub Secret Name',\n description: `Name of the GitHub Secret to store the private key related to the Deploy Key. Defaults to: 'KEY_NAME_PRIVATE_KEY' where 'KEY_NAME' is the name of the Deploy Key`,\n type: 'string',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to GitHub',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n privateKeySecretName: {\n title: 'The GitHub Action Repo Secret Name for the Private Key',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n publicKey,\n privateKey,\n deployKeyName,\n privateKeySecretName = `${deployKeyName\n .split(' ')\n .join('_')\n .toLocaleUpperCase('en-US')}_PRIVATE_KEY`,\n token: providedToken,\n } = ctx.input;\n\n const octokitOptions = await getOctokitOptions({\n integrations,\n token: providedToken,\n repoUrl: repoUrl,\n });\n\n const { owner, repo } = parseRepoUrl(repoUrl, integrations);\n\n if (!owner) {\n throw new InputError(`No owner provided for repo ${repoUrl}`);\n }\n\n const client = new Octokit(octokitOptions);\n\n await client.rest.repos.createDeployKey({\n owner: owner,\n repo: repo,\n title: deployKeyName,\n key: publicKey,\n });\n const publicKeyResponse = await client.rest.actions.getRepoPublicKey({\n owner: owner,\n repo: repo,\n });\n\n await Sodium.ready;\n const binaryKey = Sodium.from_base64(\n publicKeyResponse.data.key,\n Sodium.base64_variants.ORIGINAL,\n );\n const binarySecret = Sodium.from_string(privateKey);\n const encryptedBinarySecret = Sodium.crypto_box_seal(\n binarySecret,\n binaryKey,\n );\n const encryptedBase64Secret = Sodium.to_base64(\n encryptedBinarySecret,\n Sodium.base64_variants.ORIGINAL,\n );\n\n await client.rest.actions.createOrUpdateRepoSecret({\n owner: owner,\n repo: repo,\n secret_name: privateKeySecretName,\n encrypted_value: encryptedBase64Secret,\n key_id: publicKeyResponse.data.key_id,\n });\n\n ctx.output('privateKeySecretName', privateKeySecretName);\n },\n });\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description:\n 'Create a GitHub Environment (No Policies, No Variables, No Secrets)',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub Environment with Protected Branch Policy',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n deploymentBranchPolicy: {\n protected_branches: true,\n custom_branch_policies: false,\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub Environment with Custom Branch Policies',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n deploymentBranchPolicy: {\n protected_branches: false,\n custom_branch_policies: true,\n },\n customBranchPolicyNames: ['main', '*.*.*'],\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitHub Environment with Environment Variables and Secrets',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n environmentVariables: {\n key1: 'val1',\n key2: 'val2',\n },\n secrets: {\n secret1: 'supersecret1',\n secret2: 'supersecret2',\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub Environment with Custom Tag Policies',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n customTagPolicyNames: ['release/*/*', 'v*.*.*'],\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitHub Environment with Both Branch and Tag Policies',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n deploymentBranchPolicy: {\n protected_branches: false,\n custom_branch_policies: true,\n },\n customBranchPolicyNames: ['feature/*', 'hotfix/*'],\n customTagPolicyNames: ['release/*', 'v*'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub Environment with Full Configuration',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n deploymentBranchPolicy: {\n protected_branches: false,\n custom_branch_policies: true,\n },\n customBranchPolicyNames: ['dev/*', 'test/*'],\n customTagPolicyNames: ['v1.*', 'v2.*'],\n environmentVariables: {\n API_KEY: '123456789',\n NODE_ENV: 'production',\n },\n secrets: {\n DATABASE_URL: 'supersecretdatabaseurl',\n API_SECRET: 'supersecretapisecret',\n },\n token: 'ghp_abcdef1234567890',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub Environment with Only Token Authentication',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n token: 'ghp_abcdef1234567890',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub Environment with No Deployment Policies',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n deploymentBranchPolicy: null,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitHub Environment with Custom Branch and Tag Policies',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n deploymentBranchPolicy: {\n protected_branches: false,\n custom_branch_policies: true,\n },\n customBranchPolicyNames: ['release/*', 'hotfix/*'],\n customTagPolicyNames: ['v*', 'release-*'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub Environment with Environment Variables Only',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n environmentVariables: {\n VAR1: 'value1',\n VAR2: 'value2',\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub Environment with Deployment Secrets Only',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n secrets: {\n SECRET1: 'secretvalue1',\n SECRET2: 'secretvalue2',\n },\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitHub Environment with Deployment Branch Policy and Token',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n deploymentBranchPolicy: {\n protected_branches: true,\n custom_branch_policies: false,\n },\n token: 'ghp_abcdef1234567890',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitHub Environment with Environment Variables, Secrets, and Token',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n environmentVariables: {\n VAR1: 'value1',\n VAR2: 'value2',\n },\n secrets: {\n SECRET1: 'secretvalue1',\n SECRET2: 'secretvalue2',\n },\n token: 'ghp_abcdef1234567890',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub Environment with Wait Timer',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n waitTimer: 1000,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub Environment with Prevent Self Review',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n preventSelfReview: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitHub Environment with Reviewers',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:environment:create',\n name: 'Create Environment',\n input: {\n repoUrl: 'github.com?repo=repository&owner=owner',\n name: 'envname',\n reviewers: ['group:default/team-a', 'user:default/johndoe'],\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { getOctokitOptions } from './helpers';\nimport { Octokit } from 'octokit';\nimport Sodium from 'libsodium-wrappers';\nimport { examples } from './gitHubEnvironment.examples';\nimport { CatalogApi } from '@backstage/catalog-client';\nimport { Entity } from '@backstage/catalog-model';\n\n/**\n * Creates an `github:environment:create` Scaffolder action that creates a Github Environment.\n *\n * @public\n */\nexport function createGithubEnvironmentAction(options: {\n integrations: ScmIntegrationRegistry;\n catalogClient?: CatalogApi;\n}) {\n const { integrations, catalogClient } = options;\n // For more information on how to define custom actions, see\n // https://backstage.io/docs/features/software-templates/writing-custom-actions\n return createTemplateAction<{\n repoUrl: string;\n name: string;\n deploymentBranchPolicy?: {\n protected_branches: boolean;\n custom_branch_policies: boolean;\n };\n customBranchPolicyNames?: string[];\n customTagPolicyNames?: string[];\n environmentVariables?: { [key: string]: string };\n secrets?: { [key: string]: string };\n token?: string;\n waitTimer?: number;\n preventSelfReview?: boolean;\n reviewers?: string[];\n }>({\n id: 'github:environment:create',\n description: 'Creates Deployment Environments',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl', 'name'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n description: `Accepts the format 'github.com?repo=reponame&owner=owner' where 'reponame' is the new repository name and 'owner' is an organization or username`,\n type: 'string',\n },\n name: {\n title: 'Environment Name',\n description: `Name of the deployment environment to create`,\n type: 'string',\n },\n deploymentBranchPolicy: {\n title: 'Deployment Branch Policy',\n description: `The type of deployment branch policy for this environment. To allow all branches to deploy, set to null.`,\n type: 'object',\n required: ['protected_branches', 'custom_branch_policies'],\n properties: {\n protected_branches: {\n title: 'Protected Branches',\n description: `Whether only branches with branch protection rules can deploy to this environment. If protected_branches is true, custom_branch_policies must be false; if protected_branches is false, custom_branch_policies must be true.`,\n type: 'boolean',\n },\n custom_branch_policies: {\n title: 'Custom Branch Policies',\n description: `Whether only branches that match the specified name patterns can deploy to this environment. If custom_branch_policies is true, protected_branches must be false; if custom_branch_policies is false, protected_branches must be true.`,\n type: 'boolean',\n },\n },\n },\n customBranchPolicyNames: {\n title: 'Custom Branch Policy Name',\n description: `The name pattern that branches must match in order to deploy to the environment.\n\n Wildcard characters will not match /. For example, to match branches that begin with release/ and contain an additional single slash, use release/*/*. For more information about pattern matching syntax, see the Ruby File.fnmatch documentation.`,\n type: 'array',\n items: {\n type: 'string',\n },\n },\n customTagPolicyNames: {\n title: 'Custom Tag Policy Name',\n description: `The name pattern that tags must match in order to deploy to the environment.\n\n Wildcard characters will not match /. For example, to match tags that begin with release/ and contain an additional single slash, use release/*/*. For more information about pattern matching syntax, see the Ruby File.fnmatch documentation.`,\n type: 'array',\n items: {\n type: 'string',\n },\n },\n environmentVariables: {\n title: 'Environment Variables',\n description: `Environment variables attached to the deployment environment`,\n type: 'object',\n },\n secrets: {\n title: 'Deployment Secrets',\n description: `Secrets attached to the deployment environment`,\n type: 'object',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to GitHub',\n },\n waitTimer: {\n title: 'Wait Timer',\n type: 'integer',\n description:\n 'The time to wait before creating or updating the environment (in milliseconds)',\n },\n preventSelfReview: {\n title: 'Prevent Self Review',\n type: 'boolean',\n description: 'Whether to prevent self-review for this environment',\n },\n reviewers: {\n title: 'Reviewers',\n type: 'array',\n description: 'Reviewers for this environment',\n items: {\n type: 'string',\n },\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n name,\n deploymentBranchPolicy,\n customBranchPolicyNames,\n customTagPolicyNames,\n environmentVariables,\n secrets,\n token: providedToken,\n waitTimer,\n preventSelfReview,\n reviewers,\n } = ctx.input;\n\n // When environment creation step is executed right after a repo publish step, the repository might not be available immediately.\n // Add a 2-second delay before initiating the steps in this action.\n await new Promise(resolve => setTimeout(resolve, 2000));\n\n const octokitOptions = await getOctokitOptions({\n integrations,\n token: providedToken,\n repoUrl: repoUrl,\n });\n\n const { owner, repo } = parseRepoUrl(repoUrl, integrations);\n\n if (!owner) {\n throw new InputError(`No owner provided for repo ${repoUrl}`);\n }\n\n const client = new Octokit(octokitOptions);\n const repository = await client.rest.repos.get({\n owner: owner,\n repo: repo,\n });\n\n // convert reviewers from catalog entity to Github user or team\n const githubReviewers: { type: 'User' | 'Team'; id: number }[] = [];\n if (reviewers) {\n let reviewersEntityRefs: Array<Entity | undefined> = [];\n // Fetch reviewers from Catalog\n const catalogResponse = await catalogClient?.getEntitiesByRefs({\n entityRefs: reviewers,\n });\n if (catalogResponse?.items?.length) {\n reviewersEntityRefs = catalogResponse.items;\n }\n\n for (const reviewerEntityRef of reviewersEntityRefs) {\n if (reviewerEntityRef?.kind === 'User') {\n try {\n const user = await client.rest.users.getByUsername({\n username: reviewerEntityRef.metadata.name,\n });\n githubReviewers.push({\n type: 'User',\n id: user.data.id,\n });\n } catch (error) {\n ctx.logger.error('User not found:', error);\n }\n } else if (reviewerEntityRef?.kind === 'Group') {\n try {\n const team = await client.rest.teams.getByName({\n org: owner,\n team_slug: reviewerEntityRef.metadata.name,\n });\n githubReviewers.push({\n type: 'Team',\n id: team.data.id,\n });\n } catch (error) {\n ctx.logger.error('Team not found:', error);\n }\n }\n }\n }\n\n await client.rest.repos.createOrUpdateEnvironment({\n owner: owner,\n repo: repo,\n environment_name: name,\n deployment_branch_policy: deploymentBranchPolicy ?? null,\n wait_timer: waitTimer ?? 0,\n prevent_self_review: preventSelfReview ?? false,\n reviewers: githubReviewers.length ? githubReviewers : null,\n });\n\n if (customBranchPolicyNames) {\n for (const item of customBranchPolicyNames) {\n await client.rest.repos.createDeploymentBranchPolicy({\n owner: owner,\n repo: repo,\n type: 'branch',\n environment_name: name,\n name: item,\n });\n }\n }\n\n if (customTagPolicyNames) {\n for (const item of customTagPolicyNames) {\n await client.rest.repos.createDeploymentBranchPolicy({\n owner: owner,\n repo: repo,\n type: 'tag',\n environment_name: name,\n name: item,\n });\n }\n }\n\n for (const [key, value] of Object.entries(environmentVariables ?? {})) {\n await client.rest.actions.createEnvironmentVariable({\n repository_id: repository.data.id,\n owner: owner,\n repo: repo,\n environment_name: name,\n name: key,\n value,\n });\n }\n\n if (secrets) {\n const publicKeyResponse =\n await client.rest.actions.getEnvironmentPublicKey({\n repository_id: repository.data.id,\n owner: owner,\n repo: repo,\n environment_name: name,\n });\n\n await Sodium.ready;\n const binaryKey = Sodium.from_base64(\n publicKeyResponse.data.key,\n Sodium.base64_variants.ORIGINAL,\n );\n for (const [key, value] of Object.entries(secrets)) {\n const binarySecret = Sodium.from_string(value);\n const encryptedBinarySecret = Sodium.crypto_box_seal(\n binarySecret,\n binaryKey,\n );\n const encryptedBase64Secret = Sodium.to_base64(\n encryptedBinarySecret,\n Sodium.base64_variants.ORIGINAL,\n );\n\n await client.rest.actions.createOrUpdateEnvironmentSecret({\n repository_id: repository.data.id,\n owner: owner,\n repo: repo,\n environment_name: name,\n secret_name: key,\n encrypted_value: encryptedBase64Secret,\n key_id: publicKeyResponse.data.key_id,\n });\n }\n }\n },\n });\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Create a pull request',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:github:pull-request',\n name: 'Create a pull reuqest',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n branchName: 'new-app',\n title: 'Create my new app',\n description: 'This PR is really good',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a pull request with target branch name',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:github:pull-request',\n name: 'Create a pull reuqest with target branch name',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n branchName: 'new-app',\n title: 'Create my new app',\n description: 'This PR is really good',\n targetBranchName: 'test',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a pull request as draft',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:github:pull-request',\n name: 'Create a pull reuqest as draft',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n branchName: 'new-app',\n title: 'Create my new app',\n description: 'This PR is really good',\n draft: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a pull request with target path',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:github:pull-request',\n name: 'Create a pull reuqest with target path',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n branchName: 'new-app',\n title: 'Create my new app',\n description: 'This PR is really good',\n targetPath: 'targetPath',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a pull request with source path',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:github:pull-request',\n name: 'Create a pull reuqest with source path',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n branchName: 'new-app',\n title: 'Create my new app',\n description: 'This PR is really good',\n sourcePath: 'source',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a pull request with token',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:github:pull-request',\n name: 'Create a pull reuqest',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n branchName: 'new-app',\n title: 'Create my new app',\n description: 'This PR is really good',\n token: 'gph_YourGitHubToken',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a pull request with reviewers',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:github:pull-request',\n name: 'Create a pull reuqest with reviewers',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n branchName: 'new-app',\n title: 'Create my new app',\n description: 'This PR is really good',\n reviewers: ['foobar'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a pull request with team reviewers',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:github:pull-request',\n name: 'Create a pull reuqest with team reviewers',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n branchName: 'new-app',\n title: 'Create my new app',\n description: 'This PR is really good',\n teamReviewers: ['team-foo'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a pull request with commit message',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:github:pull-request',\n name: 'Create a pull reuqest',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n branchName: 'new-app',\n title: 'Create my new app',\n description: 'This PR is really good',\n commitMessage: 'Custom commit message',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a pull request with a git author name and email',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:github:pull-request',\n name: 'Create a pull reuqest',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n branchName: 'new-app',\n title: 'Create my new app',\n description: 'This PR is really good',\n gitAuthorName: 'Foo Bar',\n gitAuthorEmail: 'foo@bar.example',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a pull request with a git author name',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:github:pull-request',\n name: 'Create a pull reuqest',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n branchName: 'new-app',\n title: 'Create my new app',\n description: 'This PR is really good',\n // gitAuthorEmail will be 'scaffolder@backstage.io'\n // once one author attribute has been set we need to set both\n gitAuthorName: 'Foo Bar',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a pull request with a git author email',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:github:pull-request',\n name: 'Create a pull reuqest',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n branchName: 'new-app',\n title: 'Create my new app',\n description: 'This PR is really good',\n // gitAuthorName will be 'Scaffolder'\n // once one author attribute has been set we need to set both\n gitAuthorEmail: 'foo@bar.example',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a pull request with all parameters',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:github:pull-request',\n name: 'Create a pull reuqest',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n branchName: 'new-app',\n title: 'Create my new app',\n description: 'This PR is really good',\n targetBranchName: 'test',\n draft: true,\n targetPath: 'targetPath',\n sourcePath: 'source',\n token: 'gph_YourGitHubToken',\n reviewers: ['foobar'],\n teamReviewers: ['team-foo'],\n commitMessage: 'Commit for foo changes',\n gitAuthorName: 'Foo Bar',\n gitAuthorEmail: 'foo@bar.example',\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from 'path';\nimport {\n GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport {\n createTemplateAction,\n parseRepoUrl,\n SerializedFile,\n serializeDirectoryContents,\n} from '@backstage/plugin-scaffolder-node';\nimport { Octokit } from 'octokit';\nimport { CustomErrorBase, InputError } from '@backstage/errors';\nimport { createPullRequest } from 'octokit-plugin-create-pull-request';\nimport { getOctokitOptions } from './helpers';\nimport { examples } from './githubPullRequest.examples';\nimport {\n LoggerService,\n resolveSafeChildPath,\n} from '@backstage/backend-plugin-api';\nimport { Config } from '@backstage/config';\n\nexport type Encoding = 'utf-8' | 'base64';\n\nclass GithubResponseError extends CustomErrorBase {}\n\nexport const defaultClientFactory: CreateGithubPullRequestActionOptions['clientFactory'] =\n async ({\n integrations,\n githubCredentialsProvider,\n owner,\n repo,\n host = 'github.com',\n token: providedToken,\n }) => {\n const [encodedHost, encodedOwner, encodedRepo] = [host, owner, repo].map(\n encodeURIComponent,\n );\n\n const octokitOptions = await getOctokitOptions({\n integrations,\n credentialsProvider: githubCredentialsProvider,\n repoUrl: `${encodedHost}?owner=${encodedOwner}&repo=${encodedRepo}`,\n token: providedToken,\n });\n\n const OctokitPR = Octokit.plugin(createPullRequest);\n return new OctokitPR({\n ...octokitOptions,\n ...{ throttle: { enabled: false } },\n });\n };\n\n/**\n * The options passed to {@link createPublishGithubPullRequestAction} method\n * @public\n */\nexport interface CreateGithubPullRequestActionOptions {\n /**\n * An instance of {@link @backstage/integration#ScmIntegrationRegistry} that will be used in the action.\n */\n integrations: ScmIntegrationRegistry;\n /**\n * An instance of {@link @backstage/integration#GithubCredentialsProvider} that will be used to get credentials for the action.\n */\n githubCredentialsProvider?: GithubCredentialsProvider;\n /**\n * A method to return the Octokit client with the Pull Request Plugin.\n */\n clientFactory?: (input: {\n integrations: ScmIntegrationRegistry;\n githubCredentialsProvider?: GithubCredentialsProvider;\n host: string;\n owner: string;\n repo: string;\n token?: string;\n }) => Promise<\n Octokit & {\n createPullRequest(options: createPullRequest.Options): Promise<{\n data: {\n html_url: string;\n number: number;\n base: {\n ref: string;\n };\n };\n } | null>;\n }\n >;\n /**\n * An instance of {@link @backstage/config#Config} that will be used in the action.\n */\n config?: Config;\n}\n\ntype GithubPullRequest = {\n owner: string;\n repo: string;\n number: number;\n};\n\n/**\n * Creates a Github Pull Request action.\n * @public\n */\nexport const createPublishGithubPullRequestAction = (\n options: CreateGithubPullRequestActionOptions,\n) => {\n const {\n integrations,\n githubCredentialsProvider,\n clientFactory = defaultClientFactory,\n config,\n } = options;\n\n return createTemplateAction<{\n title: string;\n branchName: string;\n targetBranchName?: string;\n description: string;\n repoUrl: string;\n draft?: boolean;\n targetPath?: string;\n sourcePath?: string;\n token?: string;\n reviewers?: string[];\n teamReviewers?: string[];\n commitMessage?: string;\n update?: boolean;\n forceFork?: boolean;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n forceEmptyGitAuthor?: boolean;\n }>({\n id: 'publish:github:pull-request',\n examples,\n supportsDryRun: true,\n schema: {\n input: {\n required: ['repoUrl', 'title', 'description', 'branchName'],\n type: 'object',\n properties: {\n repoUrl: {\n title: 'Repository Location',\n description: `Accepts the format 'github.com?repo=reponame&owner=owner' where 'reponame' is the repository name and 'owner' is an organization or username`,\n type: 'string',\n },\n branchName: {\n type: 'string',\n title: 'Branch Name',\n description: 'The name for the branch',\n },\n targetBranchName: {\n type: 'string',\n title: 'Target Branch Name',\n description: 'The target branch name of the merge request',\n },\n title: {\n type: 'string',\n title: 'Pull Request Name',\n description: 'The name for the pull request',\n },\n description: {\n type: 'string',\n title: 'Pull Request Description',\n description: 'The description of the pull request',\n },\n draft: {\n type: 'boolean',\n title: 'Create as Draft',\n description: 'Create a draft pull request',\n },\n sourcePath: {\n type: 'string',\n title: 'Working Subdirectory',\n description:\n 'Subdirectory of working directory to copy changes from',\n },\n targetPath: {\n type: 'string',\n title: 'Repository Subdirectory',\n description: 'Subdirectory of repository to apply changes to',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to GitHub',\n },\n reviewers: {\n title: 'Pull Request Reviewers',\n type: 'array',\n items: {\n type: 'string',\n },\n description:\n 'The users that will be added as reviewers to the pull request',\n },\n teamReviewers: {\n title: 'Pull Request Team Reviewers',\n type: 'array',\n items: {\n type: 'string',\n },\n description:\n 'The teams that will be added as reviewers to the pull request',\n },\n commitMessage: {\n type: 'string',\n title: 'Commit Message',\n description: 'The commit message for the pull request commit',\n },\n update: {\n type: 'boolean',\n title: 'Update',\n description: 'Update pull request if already exists',\n },\n forceFork: {\n type: 'boolean',\n title: 'Force Fork',\n description: 'Create pull request from a fork',\n },\n gitAuthorName: {\n type: 'string',\n title: 'Default Author Name',\n description:\n \"Sets the default author name for the commit. The default value is the authenticated user or 'Scaffolder'\",\n },\n gitAuthorEmail: {\n type: 'string',\n title: 'Default Author Email',\n description:\n \"Sets the default author email for the commit. The default value is the authenticated user or 'scaffolder@backstage.io'\",\n },\n forceEmptyGitAuthor: {\n type: 'boolean',\n title: 'Force Empty Git Author',\n description:\n 'Forces the author to be empty. This is useful when using a Github App, it permit the commit to be verified on Github',\n },\n },\n },\n output: {\n required: ['remoteUrl'],\n type: 'object',\n properties: {\n targetBranchName: {\n title: 'Target branch name of the merge request',\n type: 'string',\n },\n remoteUrl: {\n type: 'string',\n title: 'Pull Request URL',\n description: 'Link to the pull request in Github',\n },\n pullRequestNumber: {\n type: 'number',\n title: 'Pull Request Number',\n description: 'The pull request number',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n branchName,\n targetBranchName,\n title,\n description,\n draft,\n targetPath,\n sourcePath,\n token: providedToken,\n reviewers,\n teamReviewers,\n commitMessage,\n update,\n forceFork,\n gitAuthorEmail,\n gitAuthorName,\n forceEmptyGitAuthor,\n } = ctx.input;\n\n const { owner, repo, host } = parseRepoUrl(repoUrl, integrations);\n\n if (!owner) {\n throw new InputError(\n `No owner provided for host: ${host}, and repo ${repo}`,\n );\n }\n\n const client = await clientFactory({\n integrations,\n githubCredentialsProvider,\n host,\n owner,\n repo,\n token: providedToken,\n });\n\n const fileRoot = sourcePath\n ? resolveSafeChildPath(ctx.workspacePath, sourcePath)\n : ctx.workspacePath;\n\n const directoryContents = await serializeDirectoryContents(fileRoot, {\n gitignore: true,\n });\n\n const determineFileMode = (file: SerializedFile): string => {\n if (file.symlink) return '120000';\n if (file.executable) return '100755';\n return '100644';\n };\n\n const determineFileEncoding = (\n file: SerializedFile,\n ): 'utf-8' | 'base64' => (file.symlink ? 'utf-8' : 'base64');\n\n const files = Object.fromEntries(\n directoryContents.map(file => [\n targetPath ? path.posix.join(targetPath, file.path) : file.path,\n {\n // See the properties of tree items\n // in https://docs.github.com/en/rest/reference/git#trees\n mode: determineFileMode(file),\n // Always use base64 encoding where possible to avoid doubling a binary file in size\n // due to interpreting a binary file as utf-8 and sending github\n // the utf-8 encoded content. Symlinks are kept as utf-8 to avoid them\n // being formatted as a series of scrambled characters\n //\n // For example, the original gradle-wrapper.jar is 57.8k in https://github.com/kennethzfeng/pull-request-test/pull/5/files.\n // Its size could be doubled to 98.3K (See https://github.com/kennethzfeng/pull-request-test/pull/4/files)\n encoding: determineFileEncoding(file),\n content: file.content.toString(determineFileEncoding(file)),\n },\n ]),\n );\n\n // If this is a dry run, log and return\n if (ctx.isDryRun) {\n ctx.logger.info(`Performing dry run of creating pull request`);\n ctx.output('targetBranchName', branchName);\n ctx.output('remoteUrl', repoUrl);\n ctx.output('pullRequestNumber', 43);\n ctx.logger.info(`Dry run complete`);\n return;\n }\n\n try {\n const createOptions: createPullRequest.Options = {\n owner,\n repo,\n title,\n changes: [\n {\n files,\n commit:\n commitMessage ??\n config?.getOptionalString('scaffolder.defaultCommitMessage') ??\n title,\n },\n ],\n body: description,\n head: branchName,\n draft,\n update,\n forceFork,\n };\n\n const gitAuthorInfo = {\n name:\n gitAuthorName ??\n config?.getOptionalString('scaffolder.defaultAuthor.name'),\n email:\n gitAuthorEmail ??\n config?.getOptionalString('scaffolder.defaultAuthor.email'),\n };\n\n if (!forceEmptyGitAuthor) {\n if (gitAuthorInfo.name || gitAuthorInfo.email) {\n if (Array.isArray(createOptions.changes)) {\n createOptions.changes = createOptions.changes.map(change => ({\n ...change,\n author: {\n name: gitAuthorInfo.name || 'Scaffolder',\n email: gitAuthorInfo.email || 'scaffolder@backstage.io',\n },\n }));\n } else {\n createOptions.changes = {\n ...createOptions.changes,\n author: {\n name: gitAuthorInfo.name || 'Scaffolder',\n email: gitAuthorInfo.email || 'scaffolder@backstage.io',\n },\n };\n }\n }\n }\n\n if (targetBranchName) {\n createOptions.base = targetBranchName;\n }\n const response = await client.createPullRequest(createOptions);\n\n if (!response) {\n throw new GithubResponseError('null response from Github');\n }\n\n const pullRequestNumber = response.data.number;\n if (reviewers || teamReviewers) {\n const pullRequest = { owner, repo, number: pullRequestNumber };\n await requestReviewersOnPullRequest(\n pullRequest,\n reviewers,\n teamReviewers,\n client,\n ctx.logger,\n );\n }\n\n const targetBranch = response.data.base.ref;\n ctx.output('targetBranchName', targetBranch);\n ctx.output('remoteUrl', response.data.html_url);\n ctx.output('pullRequestNumber', pullRequestNumber);\n } catch (e) {\n throw new GithubResponseError('Pull request creation failed', e);\n }\n },\n });\n\n async function requestReviewersOnPullRequest(\n pr: GithubPullRequest,\n reviewers: string[] | undefined,\n teamReviewers: string[] | undefined,\n client: Octokit,\n logger: LoggerService,\n ) {\n try {\n const result = await client.rest.pulls.requestReviewers({\n owner: pr.owner,\n repo: pr.repo,\n pull_number: pr.number,\n reviewers,\n team_reviewers: teamReviewers ? [...new Set(teamReviewers)] : undefined,\n });\n const addedUsers = result.data.requested_reviewers?.join(', ') ?? '';\n const addedTeams = result.data.requested_teams?.join(', ') ?? '';\n logger.info(\n `Added users [${addedUsers}] and teams [${addedTeams}] as reviewers to Pull request ${pr.number}`,\n );\n } catch (e) {\n logger.error(\n `Failure when adding reviewers to Pull request ${pr.number}`,\n e,\n );\n }\n }\n};\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description:\n 'Initializes a git repository with the content in the workspace, and publishes it to GitHub with the default configuration.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:github',\n name: 'Publish to GitHub',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a GitHub repository with a description.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:github',\n name: 'Publish to GitHub',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n description: 'Initialize a git repository',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a GitHub repository with public repo visibility, if not set defaults to private',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:github',\n name: 'Publish to GitHub',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n repoVisibility: 'public',\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config } from '@backstage/config';\nimport { InputError } from '@backstage/errors';\nimport {\n GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport { Octokit } from 'octokit';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport {\n createGithubRepoWithCollaboratorsAndTopics,\n getOctokitOptions,\n initRepoPushAndProtect,\n} from './helpers';\nimport * as inputProps from './inputProperties';\nimport * as outputProps from './outputProperties';\nimport { examples } from './github.examples';\n\n/**\n * Creates a new action that initializes a git repository of the content in the workspace\n * and publishes it to GitHub.\n *\n * @public\n */\nexport function createPublishGithubAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n githubCredentialsProvider?: GithubCredentialsProvider;\n}) {\n const { integrations, config, githubCredentialsProvider } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n description?: string;\n homepage?: string;\n access?: string;\n defaultBranch?: string;\n protectDefaultBranch?: boolean;\n protectEnforceAdmins?: boolean;\n deleteBranchOnMerge?: boolean;\n gitCommitMessage?: string;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n allowRebaseMerge?: boolean;\n allowSquashMerge?: boolean;\n squashMergeCommitTitle?: 'PR_TITLE' | 'COMMIT_OR_PR_TITLE';\n squashMergeCommitMessage?: 'PR_BODY' | 'COMMIT_MESSAGES' | 'BLANK';\n allowMergeCommit?: boolean;\n allowAutoMerge?: boolean;\n sourcePath?: string;\n bypassPullRequestAllowances?:\n | {\n users?: string[];\n teams?: string[];\n apps?: string[];\n }\n | undefined;\n requiredApprovingReviewCount?: number;\n restrictions?:\n | {\n users: string[];\n teams: string[];\n apps?: string[];\n }\n | undefined;\n requireCodeOwnerReviews?: boolean;\n dismissStaleReviews?: boolean;\n requiredStatusCheckContexts?: string[];\n requireBranchesToBeUpToDate?: boolean;\n requiredConversationResolution?: boolean;\n requireLastPushApproval?: boolean;\n repoVisibility?: 'private' | 'internal' | 'public';\n collaborators?: Array<\n | {\n user: string;\n access: string;\n }\n | {\n team: string;\n access: string;\n }\n | {\n /** @deprecated This field is deprecated in favor of team */\n username: string;\n access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';\n }\n >;\n hasProjects?: boolean | undefined;\n hasWiki?: boolean | undefined;\n hasIssues?: boolean | undefined;\n token?: string;\n topics?: string[];\n repoVariables?: { [key: string]: string };\n secrets?: { [key: string]: string };\n oidcCustomization?: {\n useDefault: boolean;\n includeClaimKeys?: string[];\n };\n requiredCommitSigning?: boolean;\n customProperties?: { [key: string]: string };\n }>({\n id: 'publish:github',\n description:\n 'Initializes a git repository of contents in workspace and publishes it to GitHub.',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl'],\n properties: {\n repoUrl: inputProps.repoUrl,\n description: inputProps.description,\n homepage: inputProps.homepage,\n access: inputProps.access,\n bypassPullRequestAllowances: inputProps.bypassPullRequestAllowances,\n requiredApprovingReviewCount: inputProps.requiredApprovingReviewCount,\n restrictions: inputProps.restrictions,\n requireCodeOwnerReviews: inputProps.requireCodeOwnerReviews,\n dismissStaleReviews: inputProps.dismissStaleReviews,\n requiredStatusCheckContexts: inputProps.requiredStatusCheckContexts,\n requireBranchesToBeUpToDate: inputProps.requireBranchesToBeUpToDate,\n requiredConversationResolution:\n inputProps.requiredConversationResolution,\n requireLastPushApproval: inputProps.requireLastPushApproval,\n repoVisibility: inputProps.repoVisibility,\n defaultBranch: inputProps.defaultBranch,\n protectDefaultBranch: inputProps.protectDefaultBranch,\n protectEnforceAdmins: inputProps.protectEnforceAdmins,\n deleteBranchOnMerge: inputProps.deleteBranchOnMerge,\n gitCommitMessage: inputProps.gitCommitMessage,\n gitAuthorName: inputProps.gitAuthorName,\n gitAuthorEmail: inputProps.gitAuthorEmail,\n allowMergeCommit: inputProps.allowMergeCommit,\n allowSquashMerge: inputProps.allowSquashMerge,\n squashMergeCommitTitle: inputProps.squashMergeCommitTitle,\n squashMergeCommitMessage: inputProps.squashMergeCommitMessage,\n allowRebaseMerge: inputProps.allowRebaseMerge,\n allowAutoMerge: inputProps.allowAutoMerge,\n sourcePath: inputProps.sourcePath,\n collaborators: inputProps.collaborators,\n hasProjects: inputProps.hasProjects,\n hasWiki: inputProps.hasWiki,\n hasIssues: inputProps.hasIssues,\n token: inputProps.token,\n topics: inputProps.topics,\n repoVariables: inputProps.repoVariables,\n secrets: inputProps.secrets,\n oidcCustomization: inputProps.oidcCustomization,\n requiredCommitSigning: inputProps.requiredCommitSigning,\n customProperties: inputProps.customProperties,\n },\n },\n output: {\n type: 'object',\n properties: {\n remoteUrl: outputProps.remoteUrl,\n repoContentsUrl: outputProps.repoContentsUrl,\n commitHash: outputProps.commitHash,\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n description,\n homepage,\n access,\n requireCodeOwnerReviews = false,\n dismissStaleReviews = false,\n bypassPullRequestAllowances,\n requiredApprovingReviewCount = 1,\n restrictions,\n requiredStatusCheckContexts = [],\n requireBranchesToBeUpToDate = true,\n requiredConversationResolution = false,\n requireLastPushApproval = false,\n repoVisibility = 'private',\n defaultBranch = 'master',\n protectDefaultBranch = true,\n protectEnforceAdmins = true,\n deleteBranchOnMerge = false,\n gitCommitMessage,\n gitAuthorName,\n gitAuthorEmail,\n allowMergeCommit = true,\n allowSquashMerge = true,\n squashMergeCommitTitle = 'COMMIT_OR_PR_TITLE',\n squashMergeCommitMessage = 'COMMIT_MESSAGES',\n allowRebaseMerge = true,\n allowAutoMerge = false,\n collaborators,\n hasProjects = undefined,\n hasWiki = undefined,\n hasIssues = undefined,\n topics,\n repoVariables,\n secrets,\n oidcCustomization,\n token: providedToken,\n customProperties,\n requiredCommitSigning = false,\n } = ctx.input;\n\n const octokitOptions = await getOctokitOptions({\n integrations,\n credentialsProvider: githubCredentialsProvider,\n token: providedToken,\n repoUrl: repoUrl,\n });\n const client = new Octokit(octokitOptions);\n\n const { owner, repo } = parseRepoUrl(repoUrl, integrations);\n\n if (!owner) {\n throw new InputError('Invalid repository owner provided in repoUrl');\n }\n\n const newRepo = await createGithubRepoWithCollaboratorsAndTopics(\n client,\n repo,\n owner,\n repoVisibility,\n description,\n homepage,\n deleteBranchOnMerge,\n allowMergeCommit,\n allowSquashMerge,\n squashMergeCommitTitle,\n squashMergeCommitMessage,\n allowRebaseMerge,\n allowAutoMerge,\n access,\n collaborators,\n hasProjects,\n hasWiki,\n hasIssues,\n topics,\n repoVariables,\n secrets,\n oidcCustomization,\n customProperties,\n ctx.logger,\n );\n\n const remoteUrl = newRepo.clone_url;\n const repoContentsUrl = `${newRepo.html_url}/blob/${defaultBranch}`;\n\n const commitResult = await initRepoPushAndProtect(\n remoteUrl,\n octokitOptions.auth,\n ctx.workspacePath,\n ctx.input.sourcePath,\n defaultBranch,\n protectDefaultBranch,\n protectEnforceAdmins,\n owner,\n client,\n repo,\n requireCodeOwnerReviews,\n bypassPullRequestAllowances,\n requiredApprovingReviewCount,\n restrictions,\n requiredStatusCheckContexts,\n requireBranchesToBeUpToDate,\n requiredConversationResolution,\n requireLastPushApproval,\n config,\n ctx.logger,\n gitCommitMessage,\n gitAuthorName,\n gitAuthorEmail,\n dismissStaleReviews,\n requiredCommitSigning,\n );\n\n ctx.output('commitHash', commitResult?.commitHash);\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n },\n });\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'GitHub alphanumric autolink reference',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:autolinks:create',\n name: 'Create an autolink reference',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n keyPrefix: 'TICKET-',\n urlTemplate: 'https://example.com/TICKET?query=<num>',\n isAlphanumeric: false,\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport {\n GithubCredentialsProvider,\n ScmIntegrations,\n} from '@backstage/integration';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { Octokit } from 'octokit';\nimport { examples } from './githubAutolinks.examples';\nimport { getOctokitOptions } from './helpers';\n\n/**\n * Create an autolink reference for a repository\n * @public\n */\nexport function createGithubAutolinksAction(options: {\n integrations: ScmIntegrations;\n githubCredentialsProvider?: GithubCredentialsProvider;\n}) {\n const { integrations, githubCredentialsProvider } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n keyPrefix: string;\n urlTemplate: string;\n isAlphanumeric?: boolean;\n token?: string;\n }>({\n id: 'github:autolinks:create',\n description: 'Create an autolink reference for a repository',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl', 'keyPrefix', 'urlTemplate'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n description: `Accepts the format 'github.com?repo=reponame&owner=owner' where 'reponame' is the new repository name and 'owner' is an organization or username`,\n type: 'string',\n },\n keyPrefix: {\n title: 'Key Prefix',\n description:\n 'This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit.',\n type: 'string',\n },\n urlTemplate: {\n title: 'URL Template',\n description:\n 'The URL must contain <num> for the reference number. <num> matches different characters depending on the value of isAlphanumeric.',\n type: 'string',\n },\n isAlphanumeric: {\n title: 'Alphanumeric',\n description:\n 'Whether this autolink reference matches alphanumeric characters. If true, the <num> parameter of the url_template matches alphanumeric characters A-Z (case insensitive), 0-9, and -. If false, this autolink reference only matches numeric characters. Default: true',\n type: 'boolean',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to GitHub',\n },\n },\n },\n },\n async handler(ctx) {\n const { repoUrl, keyPrefix, urlTemplate, isAlphanumeric, token } =\n ctx.input;\n\n ctx.logger.info(`Creating autolink reference for repo ${repoUrl}`);\n\n const { owner, repo } = parseRepoUrl(repoUrl, integrations);\n\n if (!owner) {\n throw new InputError('Invalid repository owner provided in repoUrl');\n }\n\n const client = new Octokit(\n await getOctokitOptions({\n integrations,\n repoUrl,\n credentialsProvider: githubCredentialsProvider,\n token,\n }),\n );\n\n await client.rest.repos.createAutolink({\n owner,\n repo,\n key_prefix: keyPrefix,\n url_template: urlTemplate,\n is_alphanumeric: isAlphanumeric,\n });\n\n ctx.logger.info(`Autolink reference created successfully`);\n },\n });\n}\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Enables GitHub Pages for a repository.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:pages',\n id: 'github-pages',\n name: 'Enable GitHub Pages',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n buildType: 'workflow',\n sourceBranch: 'main',\n sourcePath: '/',\n token: 'gph_YourGitHubToken',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enables GitHub Pages for a repository with a custom source path.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:pages',\n id: 'github-pages-custom-path',\n name: 'Enable GitHub Pages with Custom Source Path',\n input: {\n repoUrl: 'github.com?repo=customPathRepo&owner=customOwner',\n sourcePath: '/docs',\n token: 'gph_YourGitHubToken',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enables GitHub Pages for a repository using legacy build type.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:pages',\n id: 'github-pages-legacy',\n name: 'Enable GitHub Pages with Legacy Build Type',\n input: {\n repoUrl: 'github.com?repo=legacyRepo&owner=legacyOwner',\n buildType: 'legacy',\n token: 'gph_YourGitHubToken',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enables GitHub Pages for a repository with a custom source branch.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:pages',\n id: 'github-pages-custom-branch',\n name: 'Enable GitHub Pages with Custom Source Branch',\n input: {\n repoUrl: 'github.com?repo=customBranchRepo&owner=branchOwner',\n sourceBranch: 'develop',\n token: 'gph_YourGitHubToken',\n },\n },\n ],\n }),\n },\n\n {\n description:\n 'Enables GitHub Pages for a repository with full customization.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:pages',\n id: 'github-pages-full-custom',\n name: 'Enable GitHub Pages with Full Customization',\n input: {\n repoUrl: 'github.com?repo=fullCustomRepo&owner=customOwner',\n buildType: 'workflow',\n sourceBranch: 'main',\n sourcePath: '/docs',\n token: 'gph_YourGitHubToken',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enables GitHub Pages for a repository with minimal configuration.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:pages',\n id: 'github-pages-minimal',\n name: 'Enable GitHub Pages with Minimal Configuration',\n input: {\n repoUrl: 'github.com?repo=minimalRepo&owner=minimalOwner',\n token: 'gph_YourGitHubToken',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enables GitHub Pages for a repository with custom build type and source path.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:pages',\n id: 'github-pages-custom-build-path',\n name: 'Enable GitHub Pages with Custom Build Type and Source Path',\n input: {\n repoUrl: 'github.com?repo=customBuildPathRepo&owner=customOwner',\n buildType: 'legacy',\n sourcePath: '/custom-path',\n token: 'gph_YourGitHubToken',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enables GitHub Pages for a repository with custom source branch and path.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:pages',\n id: 'github-pages-custom-branch-path',\n name: 'Enable GitHub Pages with Custom Source Branch and Path',\n input: {\n repoUrl:\n 'github.com?repo=customBranchPathRepo&owner=branchPathOwner',\n sourceBranch: 'feature-branch',\n sourcePath: '/project-docs',\n token: 'gph_YourGitHubToken',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enables GitHub Pages for a repository with a custom owner and repository name.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:pages',\n id: 'github-pages-custom-owner-repo',\n name: 'Enable GitHub Pages with Custom Owner and Repository Name',\n input: {\n repoUrl: 'github.com?repo=customRepoName&owner=customOwnerName',\n token: 'gph_YourGitHubToken',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enables GitHub Pages for a repository with full customization and a different token.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:pages',\n id: 'github-pages-full-custom-diff-token',\n name: 'Enable GitHub Pages with Full Customization and Different Token',\n input: {\n repoUrl: 'github.com?repo=customTokenRepo&owner=tokenOwner',\n buildType: 'workflow',\n sourceBranch: 'main',\n sourcePath: '/site',\n token: 'gph_DifferentGitHubToken',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enables GitHub Pages for a repository with a specific token for authorization.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:pages',\n id: 'github-pages-specific-token',\n name: 'Enable GitHub Pages with Specific Token',\n input: {\n repoUrl: 'github.com?repo=specificTokenRepo&owner=tokenOwner',\n token: 'gph_SpecificGitHubToken',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Enables GitHub Pages for a documentation site with custom configuration.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:pages',\n id: 'github-pages-doc-site',\n name: 'Enable GitHub Pages for Documentation Site',\n input: {\n repoUrl: 'github.com?repo=docSiteRepo&owner=docsOwner',\n buildType: 'workflow',\n sourceBranch: 'docs-branch',\n sourcePath: '/docs-site',\n token: 'gph_DocsGitHubToken',\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport {\n GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport { Octokit } from 'octokit';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { examples } from './githubPagesEnable.examples';\nimport { getOctokitOptions } from '@backstage/plugin-scaffolder-backend-module-github';\n\n/**\n * Creates a new action that enables GitHub Pages for a repository.\n *\n * @public\n */\nexport function createGithubPagesEnableAction(options: {\n integrations: ScmIntegrationRegistry;\n githubCredentialsProvider?: GithubCredentialsProvider;\n}) {\n const { integrations, githubCredentialsProvider } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n buildType?: 'legacy' | 'workflow';\n sourceBranch?: string;\n sourcePath?: '/' | '/docs';\n token?: string;\n }>({\n id: 'github:pages:enable',\n examples,\n description: 'Enables GitHub Pages for a repository.',\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n description: `Accepts the format 'github.com?repo=reponame&owner=owner' where 'reponame' is the new repository name and 'owner' is an organization or username`,\n type: 'string',\n },\n buildType: {\n title: 'Build Type',\n type: 'string',\n description:\n 'The GitHub Pages build type - \"legacy\" or \"workflow\". Default is \"workflow',\n },\n sourceBranch: {\n title: 'Source Branch',\n type: 'string',\n description:\n 'The the GitHub Pages source branch. Default is \"main\"',\n },\n sourcePath: {\n title: 'Source Path',\n type: 'string',\n description:\n 'The the GitHub Pages source path - \"/\" or \"/docs\". Default is \"/\"',\n },\n token: {\n title: 'Authorization Token',\n type: 'string',\n description: 'The token to use for authorization to GitHub',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n buildType = 'workflow',\n sourceBranch = 'main',\n sourcePath = '/',\n token: providedToken,\n } = ctx.input;\n\n const octokitOptions = await getOctokitOptions({\n integrations,\n credentialsProvider: githubCredentialsProvider,\n token: providedToken,\n repoUrl: repoUrl,\n });\n const client = new Octokit(octokitOptions);\n\n const { owner, repo } = parseRepoUrl(repoUrl, integrations);\n\n if (!owner) {\n throw new InputError('Invalid repository owner provided in repoUrl');\n }\n\n ctx.logger.info(\n `Attempting to enable GitHub Pages for ${owner}/${repo} with \"${buildType}\" build type, on source branch \"${sourceBranch}\" and source path \"${sourcePath}\"`,\n );\n\n await client.request('POST /repos/{owner}/{repo}/pages', {\n owner: owner,\n repo: repo,\n build_type: buildType,\n source: {\n branch: sourceBranch,\n path: sourcePath,\n },\n headers: {\n 'X-GitHub-Api-Version': '2022-11-28',\n },\n });\n\n ctx.logger.info('Completed enabling GitHub Pages');\n },\n });\n}\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport {\n createGithubActionsDispatchAction,\n createGithubAutolinksAction,\n createGithubDeployKeyAction,\n createGithubEnvironmentAction,\n createGithubIssuesLabelAction,\n createGithubRepoCreateAction,\n createGithubRepoPushAction,\n createGithubWebhookAction,\n createPublishGithubAction,\n createPublishGithubPullRequestAction,\n createGithubPagesEnableAction,\n} from './actions';\nimport {\n DefaultGithubCredentialsProvider,\n ScmIntegrations,\n} from '@backstage/integration';\nimport { CatalogClient } from '@backstage/catalog-client';\n\n/**\n * @public\n * The GitHub Module for the Scaffolder Backend\n */\nexport const githubModule = createBackendModule({\n pluginId: 'scaffolder',\n moduleId: 'github',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n config: coreServices.rootConfig,\n discovery: coreServices.discovery,\n },\n async init({ scaffolder, config, discovery }) {\n const integrations = ScmIntegrations.fromConfig(config);\n const githubCredentialsProvider =\n DefaultGithubCredentialsProvider.fromIntegrations(integrations);\n const catalogClient = new CatalogClient({\n discoveryApi: discovery,\n });\n\n scaffolder.addActions(\n createGithubActionsDispatchAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubAutolinksAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubDeployKeyAction({\n integrations,\n }),\n createGithubEnvironmentAction({\n integrations,\n catalogClient,\n }),\n createGithubIssuesLabelAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubRepoCreateAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubRepoPushAction({ integrations, config }),\n createGithubWebhookAction({\n integrations,\n githubCredentialsProvider,\n }),\n createPublishGithubAction({\n integrations,\n config,\n githubCredentialsProvider,\n }),\n createPublishGithubPullRequestAction({\n integrations,\n githubCredentialsProvider,\n config,\n }),\n createGithubPagesEnableAction({\n integrations,\n githubCredentialsProvider,\n }),\n );\n },\n });\n },\n});\n"],"names":["assertError","parseRepoUrl","InputError","DefaultGithubCredentialsProvider","Sodium","initRepoAndPush","getRepoSourceDirectory","NotFoundError","examples","yaml","createTemplateAction","Octokit","inputProps.repoUrl","inputProps.description","inputProps.homepage","inputProps.access","inputProps.requireCodeOwnerReviews","inputProps.bypassPullRequestAllowances","inputProps.requiredApprovingReviewCount","inputProps.restrictions","inputProps.requiredStatusCheckContexts","inputProps.requireBranchesToBeUpToDate","inputProps.requiredConversationResolution","inputProps.repoVisibility","inputProps.deleteBranchOnMerge","inputProps.allowMergeCommit","inputProps.allowSquashMerge","inputProps.squashMergeCommitTitle","inputProps.squashMergeCommitMessage","inputProps.allowRebaseMerge","inputProps.allowAutoMerge","inputProps.collaborators","inputProps.hasProjects","inputProps.hasWiki","inputProps.hasIssues","inputProps.token","inputProps.topics","inputProps.repoVariables","inputProps.secrets","inputProps.oidcCustomization","inputProps.requiredCommitSigning","inputProps.customProperties","outputProps.remoteUrl","outputProps.repoContentsUrl","inputProps.dismissStaleReviews","inputProps.requireLastPushApproval","inputProps.defaultBranch","inputProps.protectDefaultBranch","inputProps.protectEnforceAdmins","inputProps.gitCommitMessage","inputProps.gitAuthorName","inputProps.gitAuthorEmail","inputProps.sourcePath","outputProps.commitHash","emitterEventNames","CustomErrorBase","createPullRequest","resolveSafeChildPath","serializeDirectoryContents","path","getOctokitOptions","createBackendModule","scaffolderActionsExtensionPoint","coreServices","ScmIntegrations","catalogClient","CatalogClient"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+CO,MAAM,4CAA4C,OAAO;AAAA,EAC9D,QAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,uBAAA;AAAA,EACA,2BAAA;AAAA,EACA,4BAAA;AAAA,EACA,YAAA;AAAA,EACA,8BAA8B,EAAC;AAAA,EAC/B,2BAA8B,GAAA,IAAA;AAAA,EAC9B,8BAAiC,GAAA,KAAA;AAAA,EACjC,uBAA0B,GAAA,KAAA;AAAA,EAC1B,aAAgB,GAAA,QAAA;AAAA,EAChB,aAAgB,GAAA,IAAA;AAAA,EAChB,mBAAsB,GAAA,KAAA;AAAA,EACtB,qBAAwB,GAAA,KAAA;AAC1B,CAA8C,KAAA;AAC5C,EAAA,MAAM,UAAU,YAAY;AAC1B,IAAI,IAAA;AACF,MAAM,MAAA,MAAA,CAAO,IAAK,CAAA,KAAA,CAAM,sBAAuB,CAAA;AAAA,QAC7C,SAAW,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAQT,QAAA,EAAU,CAAC,mBAAmB,CAAA;AAAA,SAChC;AAAA,QACA,KAAA;AAAA,QACA,IAAM,EAAA,QAAA;AAAA,QACN,MAAQ,EAAA,aAAA;AAAA,QACR,sBAAwB,EAAA;AAAA,UACtB,MAAQ,EAAA,2BAAA;AAAA,UACR,QAAU,EAAA,2BAAA;AAAA,SACZ;AAAA,QACA,cAAc,YAAgB,IAAA,IAAA;AAAA,QAC9B,cAAgB,EAAA,aAAA;AAAA,QAChB,6BAA+B,EAAA;AAAA,UAC7B,+BAAiC,EAAA,4BAAA;AAAA,UACjC,0BAA4B,EAAA,uBAAA;AAAA,UAC5B,8BAAgC,EAAA,2BAAA;AAAA,UAChC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