@backstage/plugin-scaffolder-backend-module-github 0.6.1-next.0 → 0.6.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.
- package/CHANGELOG.md +28 -0
- package/dist/actions/githubEnvironment.cjs.js +4 -4
- package/dist/actions/githubEnvironment.cjs.js.map +1 -1
- package/dist/index.d.ts +160 -160
- package/package.json +7 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-backend-module-github
|
|
2
2
|
|
|
3
|
+
## 0.6.1-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9391f58: Pass `undefined` to some parameters for `createOrUpdateEnvironment` as these values are not always supported in different plans of GitHub
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/plugin-scaffolder-node@0.8.0-next.2
|
|
10
|
+
- @backstage/integration@1.16.2-next.0
|
|
11
|
+
- @backstage/backend-plugin-api@1.2.1-next.1
|
|
12
|
+
- @backstage/catalog-client@1.9.1
|
|
13
|
+
- @backstage/catalog-model@1.7.3
|
|
14
|
+
- @backstage/config@1.3.2
|
|
15
|
+
- @backstage/errors@1.2.7
|
|
16
|
+
|
|
17
|
+
## 0.6.1-next.1
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 09cf038: Got rid of most `@backstage/backend-common` usages
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @backstage/plugin-scaffolder-node@0.7.1-next.1
|
|
24
|
+
- @backstage/backend-plugin-api@1.2.1-next.1
|
|
25
|
+
- @backstage/catalog-client@1.9.1
|
|
26
|
+
- @backstage/catalog-model@1.7.3
|
|
27
|
+
- @backstage/config@1.3.2
|
|
28
|
+
- @backstage/errors@1.2.7
|
|
29
|
+
- @backstage/integration@1.16.1
|
|
30
|
+
|
|
3
31
|
## 0.6.1-next.0
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
|
@@ -188,10 +188,10 @@ Wildcard characters will not match \`/\`. For example, to match tags that begin
|
|
|
188
188
|
owner,
|
|
189
189
|
repo,
|
|
190
190
|
environment_name: name,
|
|
191
|
-
deployment_branch_policy: deploymentBranchPolicy ??
|
|
192
|
-
wait_timer: waitTimer ?? 0,
|
|
193
|
-
prevent_self_review: preventSelfReview ??
|
|
194
|
-
reviewers: githubReviewers.length ? githubReviewers :
|
|
191
|
+
deployment_branch_policy: deploymentBranchPolicy ?? void 0,
|
|
192
|
+
wait_timer: waitTimer ?? void 0,
|
|
193
|
+
prevent_self_review: preventSelfReview ?? void 0,
|
|
194
|
+
reviewers: githubReviewers.length ? githubReviewers : void 0
|
|
195
195
|
});
|
|
196
196
|
if (customBranchPolicyNames) {
|
|
197
197
|
for (const item of customBranchPolicyNames) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"githubEnvironment.cjs.js","sources":["../../src/actions/githubEnvironment.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 { InputError } from '@backstage/errors';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { getOctokitOptions } from '../util';\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';\nimport { AuthService } from '@backstage/backend-plugin-api';\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 auth?: AuthService;\n}) {\n const { integrations, catalogClient, auth } = 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:\n '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:\n '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:\n '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:\n '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\nWildcard 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\nWildcard 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:\n 'Reviewers for this environment. Must be a list of Backstage entity references.',\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 const { token } = (await auth?.getPluginRequestToken({\n onBehalfOf: await ctx.getInitiatorCredentials(),\n targetPluginId: 'catalog',\n })) ?? { token: ctx.secrets?.backstageToken };\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 { host, owner, repo } = parseRepoUrl(repoUrl, integrations);\n\n if (!owner) {\n throw new InputError(`No owner provided for repo ${repoUrl}`);\n }\n\n const octokitOptions = await getOctokitOptions({\n integrations,\n token: providedToken,\n host,\n owner,\n repo,\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 {\n entityRefs: reviewers,\n },\n {\n token,\n },\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"],"names":["createTemplateAction","examples","parseRepoUrl","InputError","getOctokitOptions","Octokit","Sodium"],"mappings":";;;;;;;;;;;;;AAmCO,SAAS,8BAA8B,OAI3C,EAAA;AACD,EAAA,MAAM,EAAE,YAAA,EAAc,aAAe,EAAA,IAAA,EAAS,GAAA,OAAA;AAG9C,EAAA,OAAOA,yCAeJ,CAAA;AAAA,IACD,EAAI,EAAA,2BAAA;AAAA,IACJ,WAAa,EAAA,iCAAA;AAAA,cACbC,mCAAA;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,IAAM,EAAA,QAAA;AAAA,QACN,QAAA,EAAU,CAAC,SAAA,EAAW,MAAM,CAAA;AAAA,QAC5B,UAAY,EAAA;AAAA,UACV,OAAS,EAAA;AAAA,YACP,KAAO,EAAA,qBAAA;AAAA,YACP,WACE,EAAA,kJAAA;AAAA,YACF,IAAM,EAAA;AAAA,WACR;AAAA,UAC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A,YACnC,YAAA;AAAA,YACA;AAAA,WACF;AACA,UAAA,MAAM,wBAAwBA,uBAAO,CAAA,SAAA;AAAA,YACnC,qBAAA;AAAA,YACAA,wBAAO,eAAgB,CAAA;AAAA,WACzB;AAEA,UAAM,MAAA,MAAA,CAAO,IAAK,CAAA,OAAA,CAAQ,+BAAgC,CAAA;AAAA,YACxD,aAAA,EAAe,WAAW,IAAK,CAAA,EAAA;AAAA,YAC/B,KAAA;AAAA,YACA,IAAA;AAAA,YACA,gBAAkB,EAAA,IAAA;AAAA,YAClB,WAAa,EAAA,GAAA;AAAA,YACb,eAAiB,EAAA,qBAAA;AAAA,YACjB,MAAA,EAAQ,kBAAkB,IAAK,CAAA;AAAA,WAChC,CAAA;AAAA;AACH;AACF;AACF,GACD,CAAA;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"githubEnvironment.cjs.js","sources":["../../src/actions/githubEnvironment.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 { InputError } from '@backstage/errors';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { getOctokitOptions } from '../util';\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';\nimport { AuthService } from '@backstage/backend-plugin-api';\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 auth?: AuthService;\n}) {\n const { integrations, catalogClient, auth } = 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:\n '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:\n '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:\n '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:\n '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\nWildcard 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\nWildcard 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:\n 'Reviewers for this environment. Must be a list of Backstage entity references.',\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 const { token } = (await auth?.getPluginRequestToken({\n onBehalfOf: await ctx.getInitiatorCredentials(),\n targetPluginId: 'catalog',\n })) ?? { token: ctx.secrets?.backstageToken };\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 { host, owner, repo } = parseRepoUrl(repoUrl, integrations);\n\n if (!owner) {\n throw new InputError(`No owner provided for repo ${repoUrl}`);\n }\n\n const octokitOptions = await getOctokitOptions({\n integrations,\n token: providedToken,\n host,\n owner,\n repo,\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 {\n entityRefs: reviewers,\n },\n {\n token,\n },\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 ?? undefined,\n wait_timer: waitTimer ?? undefined,\n prevent_self_review: preventSelfReview ?? undefined,\n reviewers: githubReviewers.length ? githubReviewers : undefined,\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"],"names":["createTemplateAction","examples","parseRepoUrl","InputError","getOctokitOptions","Octokit","Sodium"],"mappings":";;;;;;;;;;;;;AAmCO,SAAS,8BAA8B,OAI3C,EAAA;AACD,EAAA,MAAM,EAAE,YAAA,EAAc,aAAe,EAAA,IAAA,EAAS,GAAA,OAAA;AAG9C,EAAA,OAAOA,yCAeJ,CAAA;AAAA,IACD,EAAI,EAAA,2BAAA;AAAA,IACJ,WAAa,EAAA,iCAAA;AAAA,cACbC,mCAAA;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,IAAM,EAAA,QAAA;AAAA,QACN,QAAA,EAAU,CAAC,SAAA,EAAW,MAAM,CAAA;AAAA,QAC5B,UAAY,EAAA;AAAA,UACV,OAAS,EAAA;AAAA,YACP,KAAO,EAAA,qBAAA;AAAA,YACP,WACE,EAAA,kJAAA;AAAA,YACF,IAAM,EAAA;AAAA,WACR;AAAA,UACA,IAAM,EAAA;AAAA,YACJ,KAAO,EAA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A;AAAA,YACA;AAAA,WACF;AACA,UAAA,MAAM,wBAAwBA,uBAAO,CAAA,SAAA;AAAA,YACnC,qBAAA;AAAA,YACAA,wBAAO,eAAgB,CAAA;AAAA,WACzB;AAEA,UAAM,MAAA,MAAA,CAAO,IAAK,CAAA,OAAA,CAAQ,+BAAgC,CAAA;AAAA,YACxD,aAAA,EAAe,WAAW,IAAK,CAAA,EAAA;AAAA,YAC/B,KAAA;AAAA,YACA,IAAA;AAAA,YACA,gBAAkB,EAAA,IAAA;AAAA,YAClB,WAAa,EAAA,GAAA;AAAA,YACb,eAAiB,EAAA,qBAAA;AAAA,YACjB,MAAA,EAAQ,kBAAkB,IAAK,CAAA;AAAA,WAChC,CAAA;AAAA;AACH;AACF;AACF,GACD,CAAA;AACH;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -22,9 +22,9 @@ declare function createGithubActionsDispatchAction(options: {
|
|
|
22
22
|
branchOrTagName: string;
|
|
23
23
|
workflowInputs?: {
|
|
24
24
|
[key: string]: string;
|
|
25
|
-
}
|
|
26
|
-
token?: string
|
|
27
|
-
}, _backstage_types.JsonObject>;
|
|
25
|
+
};
|
|
26
|
+
token?: string;
|
|
27
|
+
}, _backstage_types.JsonObject, "v1">;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Adds labels to a pull request or issue on GitHub
|
|
@@ -37,8 +37,8 @@ declare function createGithubIssuesLabelAction(options: {
|
|
|
37
37
|
repoUrl: string;
|
|
38
38
|
number: number;
|
|
39
39
|
labels: string[];
|
|
40
|
-
token?: string
|
|
41
|
-
}, _backstage_types.JsonObject>;
|
|
40
|
+
token?: string;
|
|
41
|
+
}, _backstage_types.JsonObject, "v1">;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* Creates a new action that initializes a git repository
|
|
@@ -50,35 +50,35 @@ declare function createGithubRepoCreateAction(options: {
|
|
|
50
50
|
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
51
51
|
}): _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
52
52
|
repoUrl: string;
|
|
53
|
-
description?: string
|
|
54
|
-
homepage?: string
|
|
55
|
-
access?: string
|
|
56
|
-
deleteBranchOnMerge?: boolean
|
|
57
|
-
gitAuthorName?: string
|
|
58
|
-
gitAuthorEmail?: string
|
|
59
|
-
allowRebaseMerge?: boolean
|
|
60
|
-
allowSquashMerge?: boolean
|
|
61
|
-
squashMergeCommitTitle?: "PR_TITLE" | "COMMIT_OR_PR_TITLE"
|
|
62
|
-
squashMergeCommitMessage?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK"
|
|
63
|
-
allowMergeCommit?: boolean
|
|
64
|
-
allowAutoMerge?: boolean
|
|
65
|
-
requireCodeOwnerReviews?: boolean
|
|
53
|
+
description?: string;
|
|
54
|
+
homepage?: string;
|
|
55
|
+
access?: string;
|
|
56
|
+
deleteBranchOnMerge?: boolean;
|
|
57
|
+
gitAuthorName?: string;
|
|
58
|
+
gitAuthorEmail?: string;
|
|
59
|
+
allowRebaseMerge?: boolean;
|
|
60
|
+
allowSquashMerge?: boolean;
|
|
61
|
+
squashMergeCommitTitle?: "PR_TITLE" | "COMMIT_OR_PR_TITLE";
|
|
62
|
+
squashMergeCommitMessage?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK";
|
|
63
|
+
allowMergeCommit?: boolean;
|
|
64
|
+
allowAutoMerge?: boolean;
|
|
65
|
+
requireCodeOwnerReviews?: boolean;
|
|
66
66
|
bypassPullRequestAllowances?: {
|
|
67
|
-
users?: string[]
|
|
68
|
-
teams?: string[]
|
|
69
|
-
apps?: string[]
|
|
70
|
-
}
|
|
71
|
-
requiredApprovingReviewCount?: number
|
|
67
|
+
users?: string[];
|
|
68
|
+
teams?: string[];
|
|
69
|
+
apps?: string[];
|
|
70
|
+
};
|
|
71
|
+
requiredApprovingReviewCount?: number;
|
|
72
72
|
restrictions?: {
|
|
73
73
|
users: string[];
|
|
74
74
|
teams: string[];
|
|
75
|
-
apps?: string[]
|
|
76
|
-
}
|
|
77
|
-
requiredStatusCheckContexts?: string[]
|
|
78
|
-
requireBranchesToBeUpToDate?: boolean
|
|
79
|
-
requiredConversationResolution?: boolean
|
|
80
|
-
repoVisibility?: "
|
|
81
|
-
collaborators?:
|
|
75
|
+
apps?: string[];
|
|
76
|
+
};
|
|
77
|
+
requiredStatusCheckContexts?: string[];
|
|
78
|
+
requireBranchesToBeUpToDate?: boolean;
|
|
79
|
+
requiredConversationResolution?: boolean;
|
|
80
|
+
repoVisibility?: "private" | "internal" | "public";
|
|
81
|
+
collaborators?: Array<{
|
|
82
82
|
user: string;
|
|
83
83
|
access: string;
|
|
84
84
|
} | {
|
|
@@ -87,30 +87,30 @@ declare function createGithubRepoCreateAction(options: {
|
|
|
87
87
|
} | {
|
|
88
88
|
/** @deprecated This field is deprecated in favor of team */
|
|
89
89
|
username: string;
|
|
90
|
-
access:
|
|
91
|
-
}
|
|
92
|
-
hasProjects?: boolean
|
|
93
|
-
hasWiki?: boolean
|
|
94
|
-
hasIssues?: boolean
|
|
95
|
-
token?: string
|
|
96
|
-
topics?: string[]
|
|
90
|
+
access: "pull" | "push" | "admin" | "maintain" | "triage";
|
|
91
|
+
}>;
|
|
92
|
+
hasProjects?: boolean;
|
|
93
|
+
hasWiki?: boolean;
|
|
94
|
+
hasIssues?: boolean;
|
|
95
|
+
token?: string;
|
|
96
|
+
topics?: string[];
|
|
97
97
|
repoVariables?: {
|
|
98
98
|
[key: string]: string;
|
|
99
|
-
}
|
|
99
|
+
};
|
|
100
100
|
secrets?: {
|
|
101
101
|
[key: string]: string;
|
|
102
|
-
}
|
|
102
|
+
};
|
|
103
103
|
oidcCustomization?: {
|
|
104
104
|
useDefault: boolean;
|
|
105
|
-
includeClaimKeys?: string[]
|
|
106
|
-
}
|
|
107
|
-
requireCommitSigning?: boolean
|
|
108
|
-
requiredLinearHistory?: boolean
|
|
105
|
+
includeClaimKeys?: string[];
|
|
106
|
+
};
|
|
107
|
+
requireCommitSigning?: boolean;
|
|
108
|
+
requiredLinearHistory?: boolean;
|
|
109
109
|
customProperties?: {
|
|
110
110
|
[key: string]: string;
|
|
111
|
-
}
|
|
112
|
-
subscribe?: boolean
|
|
113
|
-
}, _backstage_types.JsonObject>;
|
|
111
|
+
};
|
|
112
|
+
subscribe?: boolean;
|
|
113
|
+
}, _backstage_types.JsonObject, "v1">;
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
116
|
* Creates a new action that initializes a git repository of the content in the workspace
|
|
@@ -124,35 +124,35 @@ declare function createGithubRepoPushAction(options: {
|
|
|
124
124
|
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
125
125
|
}): _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
126
126
|
repoUrl: string;
|
|
127
|
-
description?: string
|
|
128
|
-
defaultBranch?: string
|
|
129
|
-
protectDefaultBranch?: boolean
|
|
130
|
-
protectEnforceAdmins?: boolean
|
|
131
|
-
gitCommitMessage?: string
|
|
132
|
-
gitAuthorName?: string
|
|
133
|
-
gitAuthorEmail?: string
|
|
134
|
-
requireCodeOwnerReviews?: boolean
|
|
135
|
-
dismissStaleReviews?: boolean
|
|
127
|
+
description?: string;
|
|
128
|
+
defaultBranch?: string;
|
|
129
|
+
protectDefaultBranch?: boolean;
|
|
130
|
+
protectEnforceAdmins?: boolean;
|
|
131
|
+
gitCommitMessage?: string;
|
|
132
|
+
gitAuthorName?: string;
|
|
133
|
+
gitAuthorEmail?: string;
|
|
134
|
+
requireCodeOwnerReviews?: boolean;
|
|
135
|
+
dismissStaleReviews?: boolean;
|
|
136
136
|
bypassPullRequestAllowances?: {
|
|
137
137
|
users?: string[];
|
|
138
138
|
teams?: string[];
|
|
139
139
|
apps?: string[];
|
|
140
140
|
} | undefined;
|
|
141
|
-
requiredApprovingReviewCount?: number
|
|
141
|
+
requiredApprovingReviewCount?: number;
|
|
142
142
|
restrictions?: {
|
|
143
143
|
users: string[];
|
|
144
144
|
teams: string[];
|
|
145
145
|
apps?: string[];
|
|
146
146
|
} | undefined;
|
|
147
|
-
requiredStatusCheckContexts?: string[]
|
|
148
|
-
requireBranchesToBeUpToDate?: boolean
|
|
149
|
-
requiredConversationResolution?: boolean
|
|
150
|
-
sourcePath?: string
|
|
151
|
-
token?: string
|
|
152
|
-
requiredCommitSigning?: boolean
|
|
153
|
-
requiredLinearHistory?: boolean
|
|
154
|
-
requireLastPushApproval?: boolean
|
|
155
|
-
}, _backstage_types.JsonObject>;
|
|
147
|
+
requiredStatusCheckContexts?: string[];
|
|
148
|
+
requireBranchesToBeUpToDate?: boolean;
|
|
149
|
+
requiredConversationResolution?: boolean;
|
|
150
|
+
sourcePath?: string;
|
|
151
|
+
token?: string;
|
|
152
|
+
requiredCommitSigning?: boolean;
|
|
153
|
+
requiredLinearHistory?: boolean;
|
|
154
|
+
requireLastPushApproval?: boolean;
|
|
155
|
+
}, _backstage_types.JsonObject, "v1">;
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
158
|
* Creates new action that creates a webhook for a repository on GitHub.
|
|
@@ -165,13 +165,13 @@ declare function createGithubWebhookAction(options: {
|
|
|
165
165
|
}): _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
166
166
|
repoUrl: string;
|
|
167
167
|
webhookUrl: string;
|
|
168
|
-
webhookSecret?: string
|
|
169
|
-
events?: string[]
|
|
170
|
-
active?: boolean
|
|
171
|
-
contentType?: "form" | "json"
|
|
172
|
-
insecureSsl?: boolean
|
|
173
|
-
token?: string
|
|
174
|
-
}, _backstage_types.JsonObject>;
|
|
168
|
+
webhookSecret?: string;
|
|
169
|
+
events?: string[];
|
|
170
|
+
active?: boolean;
|
|
171
|
+
contentType?: "form" | "json";
|
|
172
|
+
insecureSsl?: boolean;
|
|
173
|
+
token?: string;
|
|
174
|
+
}, _backstage_types.JsonObject, "v1">;
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
177
|
* Creates an `github:deployKey:create` Scaffolder action that creates a Deploy Key
|
|
@@ -185,9 +185,9 @@ declare function createGithubDeployKeyAction(options: {
|
|
|
185
185
|
publicKey: string;
|
|
186
186
|
privateKey: string;
|
|
187
187
|
deployKeyName: string;
|
|
188
|
-
privateKeySecretName?: string
|
|
189
|
-
token?: string
|
|
190
|
-
}, _backstage_types.JsonObject>;
|
|
188
|
+
privateKeySecretName?: string;
|
|
189
|
+
token?: string;
|
|
190
|
+
}, _backstage_types.JsonObject, "v1">;
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
193
|
* Creates an `github:environment:create` Scaffolder action that creates a Github Environment.
|
|
@@ -204,20 +204,20 @@ declare function createGithubEnvironmentAction(options: {
|
|
|
204
204
|
deploymentBranchPolicy?: {
|
|
205
205
|
protected_branches: boolean;
|
|
206
206
|
custom_branch_policies: boolean;
|
|
207
|
-
}
|
|
208
|
-
customBranchPolicyNames?: string[]
|
|
209
|
-
customTagPolicyNames?: string[]
|
|
207
|
+
};
|
|
208
|
+
customBranchPolicyNames?: string[];
|
|
209
|
+
customTagPolicyNames?: string[];
|
|
210
210
|
environmentVariables?: {
|
|
211
211
|
[key: string]: string;
|
|
212
|
-
}
|
|
212
|
+
};
|
|
213
213
|
secrets?: {
|
|
214
214
|
[key: string]: string;
|
|
215
|
-
}
|
|
216
|
-
token?: string
|
|
217
|
-
waitTimer?: number
|
|
218
|
-
preventSelfReview?: boolean
|
|
219
|
-
reviewers?: string[]
|
|
220
|
-
}, _backstage_types.JsonObject>;
|
|
215
|
+
};
|
|
216
|
+
token?: string;
|
|
217
|
+
waitTimer?: number;
|
|
218
|
+
preventSelfReview?: boolean;
|
|
219
|
+
reviewers?: string[];
|
|
220
|
+
}, _backstage_types.JsonObject, "v1">;
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
223
|
* The options passed to {@link createPublishGithubPullRequestAction} method
|
|
@@ -265,23 +265,23 @@ interface CreateGithubPullRequestActionOptions {
|
|
|
265
265
|
declare const createPublishGithubPullRequestAction: (options: CreateGithubPullRequestActionOptions) => _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
266
266
|
title: string;
|
|
267
267
|
branchName: string;
|
|
268
|
-
targetBranchName?: string
|
|
268
|
+
targetBranchName?: string;
|
|
269
269
|
description: string;
|
|
270
270
|
repoUrl: string;
|
|
271
|
-
draft?: boolean
|
|
272
|
-
targetPath?: string
|
|
273
|
-
sourcePath?: string
|
|
274
|
-
token?: string
|
|
275
|
-
reviewers?: string[]
|
|
276
|
-
teamReviewers?: string[]
|
|
277
|
-
commitMessage?: string
|
|
278
|
-
update?: boolean
|
|
279
|
-
forceFork?: boolean
|
|
280
|
-
gitAuthorName?: string
|
|
281
|
-
gitAuthorEmail?: string
|
|
282
|
-
forceEmptyGitAuthor?: boolean
|
|
283
|
-
createWhenEmpty?: boolean
|
|
284
|
-
}, _backstage_types.JsonObject>;
|
|
271
|
+
draft?: boolean;
|
|
272
|
+
targetPath?: string;
|
|
273
|
+
sourcePath?: string;
|
|
274
|
+
token?: string;
|
|
275
|
+
reviewers?: string[];
|
|
276
|
+
teamReviewers?: string[];
|
|
277
|
+
commitMessage?: string;
|
|
278
|
+
update?: boolean;
|
|
279
|
+
forceFork?: boolean;
|
|
280
|
+
gitAuthorName?: string;
|
|
281
|
+
gitAuthorEmail?: string;
|
|
282
|
+
forceEmptyGitAuthor?: boolean;
|
|
283
|
+
createWhenEmpty?: boolean;
|
|
284
|
+
}, _backstage_types.JsonObject, "v1">;
|
|
285
285
|
|
|
286
286
|
/**
|
|
287
287
|
* Creates a new action that initializes a git repository of the content in the workspace
|
|
@@ -295,42 +295,42 @@ declare function createPublishGithubAction(options: {
|
|
|
295
295
|
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
296
296
|
}): _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
297
297
|
repoUrl: string;
|
|
298
|
-
description?: string
|
|
299
|
-
homepage?: string
|
|
300
|
-
access?: string
|
|
301
|
-
defaultBranch?: string
|
|
302
|
-
protectDefaultBranch?: boolean
|
|
303
|
-
protectEnforceAdmins?: boolean
|
|
304
|
-
deleteBranchOnMerge?: boolean
|
|
305
|
-
gitCommitMessage?: string
|
|
306
|
-
gitAuthorName?: string
|
|
307
|
-
gitAuthorEmail?: string
|
|
308
|
-
allowRebaseMerge?: boolean
|
|
309
|
-
allowSquashMerge?: boolean
|
|
310
|
-
squashMergeCommitTitle?: "PR_TITLE" | "COMMIT_OR_PR_TITLE"
|
|
311
|
-
squashMergeCommitMessage?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK"
|
|
312
|
-
allowMergeCommit?: boolean
|
|
313
|
-
allowAutoMerge?: boolean
|
|
314
|
-
sourcePath?: string
|
|
298
|
+
description?: string;
|
|
299
|
+
homepage?: string;
|
|
300
|
+
access?: string;
|
|
301
|
+
defaultBranch?: string;
|
|
302
|
+
protectDefaultBranch?: boolean;
|
|
303
|
+
protectEnforceAdmins?: boolean;
|
|
304
|
+
deleteBranchOnMerge?: boolean;
|
|
305
|
+
gitCommitMessage?: string;
|
|
306
|
+
gitAuthorName?: string;
|
|
307
|
+
gitAuthorEmail?: string;
|
|
308
|
+
allowRebaseMerge?: boolean;
|
|
309
|
+
allowSquashMerge?: boolean;
|
|
310
|
+
squashMergeCommitTitle?: "PR_TITLE" | "COMMIT_OR_PR_TITLE";
|
|
311
|
+
squashMergeCommitMessage?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK";
|
|
312
|
+
allowMergeCommit?: boolean;
|
|
313
|
+
allowAutoMerge?: boolean;
|
|
314
|
+
sourcePath?: string;
|
|
315
315
|
bypassPullRequestAllowances?: {
|
|
316
316
|
users?: string[];
|
|
317
317
|
teams?: string[];
|
|
318
318
|
apps?: string[];
|
|
319
319
|
} | undefined;
|
|
320
|
-
requiredApprovingReviewCount?: number
|
|
320
|
+
requiredApprovingReviewCount?: number;
|
|
321
321
|
restrictions?: {
|
|
322
322
|
users: string[];
|
|
323
323
|
teams: string[];
|
|
324
324
|
apps?: string[];
|
|
325
325
|
} | undefined;
|
|
326
|
-
requireCodeOwnerReviews?: boolean
|
|
327
|
-
dismissStaleReviews?: boolean
|
|
328
|
-
requiredStatusCheckContexts?: string[]
|
|
329
|
-
requireBranchesToBeUpToDate?: boolean
|
|
330
|
-
requiredConversationResolution?: boolean
|
|
331
|
-
requireLastPushApproval?: boolean
|
|
332
|
-
repoVisibility?: "
|
|
333
|
-
collaborators?:
|
|
326
|
+
requireCodeOwnerReviews?: boolean;
|
|
327
|
+
dismissStaleReviews?: boolean;
|
|
328
|
+
requiredStatusCheckContexts?: string[];
|
|
329
|
+
requireBranchesToBeUpToDate?: boolean;
|
|
330
|
+
requiredConversationResolution?: boolean;
|
|
331
|
+
requireLastPushApproval?: boolean;
|
|
332
|
+
repoVisibility?: "private" | "internal" | "public";
|
|
333
|
+
collaborators?: Array<{
|
|
334
334
|
user: string;
|
|
335
335
|
access: string;
|
|
336
336
|
} | {
|
|
@@ -339,30 +339,30 @@ declare function createPublishGithubAction(options: {
|
|
|
339
339
|
} | {
|
|
340
340
|
/** @deprecated This field is deprecated in favor of team */
|
|
341
341
|
username: string;
|
|
342
|
-
access:
|
|
343
|
-
}
|
|
342
|
+
access: "pull" | "push" | "admin" | "maintain" | "triage";
|
|
343
|
+
}>;
|
|
344
344
|
hasProjects?: boolean | undefined;
|
|
345
345
|
hasWiki?: boolean | undefined;
|
|
346
346
|
hasIssues?: boolean | undefined;
|
|
347
|
-
token?: string
|
|
348
|
-
topics?: string[]
|
|
347
|
+
token?: string;
|
|
348
|
+
topics?: string[];
|
|
349
349
|
repoVariables?: {
|
|
350
350
|
[key: string]: string;
|
|
351
|
-
}
|
|
351
|
+
};
|
|
352
352
|
secrets?: {
|
|
353
353
|
[key: string]: string;
|
|
354
|
-
}
|
|
354
|
+
};
|
|
355
355
|
oidcCustomization?: {
|
|
356
356
|
useDefault: boolean;
|
|
357
|
-
includeClaimKeys?: string[]
|
|
358
|
-
}
|
|
359
|
-
requiredCommitSigning?: boolean
|
|
360
|
-
requiredLinearHistory?: boolean
|
|
357
|
+
includeClaimKeys?: string[];
|
|
358
|
+
};
|
|
359
|
+
requiredCommitSigning?: boolean;
|
|
360
|
+
requiredLinearHistory?: boolean;
|
|
361
361
|
customProperties?: {
|
|
362
362
|
[key: string]: string;
|
|
363
|
-
}
|
|
364
|
-
subscribe?: boolean
|
|
365
|
-
}, _backstage_types.JsonObject>;
|
|
363
|
+
};
|
|
364
|
+
subscribe?: boolean;
|
|
365
|
+
}, _backstage_types.JsonObject, "v1">;
|
|
366
366
|
|
|
367
367
|
/**
|
|
368
368
|
* Create an autolink reference for a repository
|
|
@@ -375,9 +375,9 @@ declare function createGithubAutolinksAction(options: {
|
|
|
375
375
|
repoUrl: string;
|
|
376
376
|
keyPrefix: string;
|
|
377
377
|
urlTemplate: string;
|
|
378
|
-
isAlphanumeric?: boolean
|
|
379
|
-
token?: string
|
|
380
|
-
}, _backstage_types.JsonObject>;
|
|
378
|
+
isAlphanumeric?: boolean;
|
|
379
|
+
token?: string;
|
|
380
|
+
}, _backstage_types.JsonObject, "v1">;
|
|
381
381
|
|
|
382
382
|
/**
|
|
383
383
|
* Creates a new action that enables GitHub Pages for a repository.
|
|
@@ -389,11 +389,11 @@ declare function createGithubPagesEnableAction(options: {
|
|
|
389
389
|
githubCredentialsProvider?: GithubCredentialsProvider;
|
|
390
390
|
}): _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
391
391
|
repoUrl: string;
|
|
392
|
-
buildType?: "legacy" | "workflow"
|
|
393
|
-
sourceBranch?: string
|
|
394
|
-
sourcePath?: "/" | "/docs"
|
|
395
|
-
token?: string
|
|
396
|
-
}, _backstage_types.JsonObject>;
|
|
392
|
+
buildType?: "legacy" | "workflow";
|
|
393
|
+
sourceBranch?: string;
|
|
394
|
+
sourcePath?: "/" | "/docs";
|
|
395
|
+
token?: string;
|
|
396
|
+
}, _backstage_types.JsonObject, "v1">;
|
|
397
397
|
|
|
398
398
|
/**
|
|
399
399
|
* Creates an `github:branch-protection:create` Scaffolder action that configured Branch Protection in a Github Repository.
|
|
@@ -404,11 +404,11 @@ declare function createGithubBranchProtectionAction(options: {
|
|
|
404
404
|
integrations: ScmIntegrationRegistry;
|
|
405
405
|
}): _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
406
406
|
repoUrl: string;
|
|
407
|
-
branch?: string
|
|
408
|
-
enforceAdmins?: boolean
|
|
409
|
-
requiredApprovingReviewCount?: number
|
|
410
|
-
requireCodeOwnerReviews?: boolean
|
|
411
|
-
dismissStaleReviews?: boolean
|
|
407
|
+
branch?: string;
|
|
408
|
+
enforceAdmins?: boolean;
|
|
409
|
+
requiredApprovingReviewCount?: number;
|
|
410
|
+
requireCodeOwnerReviews?: boolean;
|
|
411
|
+
dismissStaleReviews?: boolean;
|
|
412
412
|
bypassPullRequestAllowances?: {
|
|
413
413
|
users?: string[];
|
|
414
414
|
teams?: string[];
|
|
@@ -419,14 +419,14 @@ declare function createGithubBranchProtectionAction(options: {
|
|
|
419
419
|
teams: string[];
|
|
420
420
|
apps?: string[];
|
|
421
421
|
} | undefined;
|
|
422
|
-
requiredStatusCheckContexts?: string[]
|
|
423
|
-
requireBranchesToBeUpToDate?: boolean
|
|
424
|
-
requiredConversationResolution?: boolean
|
|
425
|
-
requireLastPushApproval?: boolean
|
|
426
|
-
requiredCommitSigning?: boolean
|
|
427
|
-
requiredLinearHistory?: boolean
|
|
428
|
-
token?: string
|
|
429
|
-
}, _backstage_types.JsonObject>;
|
|
422
|
+
requiredStatusCheckContexts?: string[];
|
|
423
|
+
requireBranchesToBeUpToDate?: boolean;
|
|
424
|
+
requiredConversationResolution?: boolean;
|
|
425
|
+
requireLastPushApproval?: boolean;
|
|
426
|
+
requiredCommitSigning?: boolean;
|
|
427
|
+
requiredLinearHistory?: boolean;
|
|
428
|
+
token?: string;
|
|
429
|
+
}, _backstage_types.JsonObject, "v1">;
|
|
430
430
|
|
|
431
431
|
/**
|
|
432
432
|
* @public
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder-backend-module-github",
|
|
3
|
-
"version": "0.6.1-next.
|
|
3
|
+
"version": "0.6.1-next.2",
|
|
4
4
|
"description": "The github module for @backstage/plugin-scaffolder-backend",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin-module",
|
|
@@ -30,13 +30,6 @@
|
|
|
30
30
|
},
|
|
31
31
|
"main": "./dist/index.cjs.js",
|
|
32
32
|
"types": "./dist/index.d.ts",
|
|
33
|
-
"typesVersions": {
|
|
34
|
-
"*": {
|
|
35
|
-
"index": [
|
|
36
|
-
"dist/index.d.ts"
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
33
|
"files": [
|
|
41
34
|
"dist"
|
|
42
35
|
],
|
|
@@ -50,14 +43,13 @@
|
|
|
50
43
|
"test": "backstage-cli package test"
|
|
51
44
|
},
|
|
52
45
|
"dependencies": {
|
|
53
|
-
"@backstage/backend-
|
|
54
|
-
"@backstage/backend-plugin-api": "1.2.1-next.0",
|
|
46
|
+
"@backstage/backend-plugin-api": "1.2.1-next.1",
|
|
55
47
|
"@backstage/catalog-client": "1.9.1",
|
|
56
48
|
"@backstage/catalog-model": "1.7.3",
|
|
57
49
|
"@backstage/config": "1.3.2",
|
|
58
50
|
"@backstage/errors": "1.2.7",
|
|
59
|
-
"@backstage/integration": "1.16.
|
|
60
|
-
"@backstage/plugin-scaffolder-node": "0.
|
|
51
|
+
"@backstage/integration": "1.16.2-next.0",
|
|
52
|
+
"@backstage/plugin-scaffolder-node": "0.8.0-next.2",
|
|
61
53
|
"@octokit/webhooks": "^10.9.2",
|
|
62
54
|
"libsodium-wrappers": "^0.7.11",
|
|
63
55
|
"octokit": "^3.0.0",
|
|
@@ -65,9 +57,9 @@
|
|
|
65
57
|
"yaml": "^2.0.0"
|
|
66
58
|
},
|
|
67
59
|
"devDependencies": {
|
|
68
|
-
"@backstage/backend-test-utils": "1.3.1-next.
|
|
69
|
-
"@backstage/cli": "0.
|
|
70
|
-
"@backstage/plugin-scaffolder-node-test-utils": "0.
|
|
60
|
+
"@backstage/backend-test-utils": "1.3.1-next.2",
|
|
61
|
+
"@backstage/cli": "0.31.0-next.1",
|
|
62
|
+
"@backstage/plugin-scaffolder-node-test-utils": "0.2.0-next.2",
|
|
71
63
|
"@types/libsodium-wrappers": "^0.7.10",
|
|
72
64
|
"fs-extra": "^11.2.0",
|
|
73
65
|
"jsonschema": "^1.2.6"
|