@backstage/plugin-scaffolder-backend-module-github 0.6.2-next.1 → 0.7.0
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 +54 -0
- package/dist/actions/github.cjs.js +4 -1
- package/dist/actions/github.cjs.js.map +1 -1
- package/dist/actions/githubDeployKey.cjs.js +34 -15
- package/dist/actions/githubDeployKey.cjs.js.map +1 -1
- package/dist/actions/githubRepoCreate.cjs.js +3 -0
- package/dist/actions/githubRepoCreate.cjs.js.map +1 -1
- package/dist/actions/githubRepoCreate.examples.cjs.js +15 -0
- package/dist/actions/githubRepoCreate.examples.cjs.js.map +1 -1
- package/dist/actions/githubRepoPush.cjs.js +1 -1
- package/dist/actions/githubRepoPush.cjs.js.map +1 -1
- package/dist/actions/helpers.cjs.js +3 -1
- package/dist/actions/helpers.cjs.js.map +1 -1
- package/dist/actions/inputProperties.cjs.js +7 -0
- package/dist/actions/inputProperties.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/package.json +19 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-backend-module-github
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c761cf5: **BREAKING** The `publish:github` scaffolder action now defaults to initializing with a branch named "main" instead of "master" when creating new repositories.
|
|
8
|
+
|
|
9
|
+
If you or your organization have relied on all new github repositories having a default branch name of "master" you **must** set the `defaultBranch: 'master'` in your existing templates that feature the `publish:github` scaffolder action.
|
|
10
|
+
|
|
11
|
+
To keep using the name "master" for your new github repos, these are the **required** changes:
|
|
12
|
+
|
|
13
|
+
```diff
|
|
14
|
+
- id: publish
|
|
15
|
+
name: Publish
|
|
16
|
+
action: publish:github
|
|
17
|
+
input:
|
|
18
|
+
allowedHosts: ['github.com']
|
|
19
|
+
description: This is ${{ parameters.name }}
|
|
20
|
+
repoUrl: ${{ parameters.repoUrl }}
|
|
21
|
+
+ defaultBranch: 'master'
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- 1af427a: Made "github:autolinks:create" action idempotent
|
|
27
|
+
- 79dc5ac: Made "github:deployKey:create" action idempotent
|
|
28
|
+
- 411c879: Add support to github:repo:create to allow branch updates
|
|
29
|
+
- 180ea6e: Made "github:branch-protection:create" action idempotent
|
|
30
|
+
- 0be1a1e: Made "publish:github" action idempotent
|
|
31
|
+
- a833f0f: Made "github:actions:dispatch" action idempotent
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
- @backstage/plugin-scaffolder-node@0.8.1
|
|
34
|
+
- @backstage/backend-plugin-api@1.3.0
|
|
35
|
+
- @backstage/integration@1.16.3
|
|
36
|
+
- @backstage/catalog-client@1.9.1
|
|
37
|
+
- @backstage/catalog-model@1.7.3
|
|
38
|
+
- @backstage/config@1.3.2
|
|
39
|
+
- @backstage/errors@1.2.7
|
|
40
|
+
- @backstage/types@1.2.1
|
|
41
|
+
|
|
42
|
+
## 0.6.2-next.2
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- 411c879: Add support to github:repo:create to allow branch updates
|
|
47
|
+
- Updated dependencies
|
|
48
|
+
- @backstage/backend-plugin-api@1.2.1
|
|
49
|
+
- @backstage/catalog-client@1.9.1
|
|
50
|
+
- @backstage/catalog-model@1.7.3
|
|
51
|
+
- @backstage/config@1.3.2
|
|
52
|
+
- @backstage/errors@1.2.7
|
|
53
|
+
- @backstage/integration@1.16.3-next.0
|
|
54
|
+
- @backstage/types@1.2.1
|
|
55
|
+
- @backstage/plugin-scaffolder-node@0.8.1-next.1
|
|
56
|
+
|
|
3
57
|
## 0.6.2-next.1
|
|
4
58
|
|
|
5
59
|
### Patch Changes
|
|
@@ -47,6 +47,7 @@ function createPublishGithubAction(options) {
|
|
|
47
47
|
squashMergeCommitMessage: inputProperties.squashMergeCommitMessage,
|
|
48
48
|
allowRebaseMerge: inputProperties.allowRebaseMerge,
|
|
49
49
|
allowAutoMerge: inputProperties.allowAutoMerge,
|
|
50
|
+
allowUpdateBranch: inputProperties.allowUpdateBranch,
|
|
50
51
|
sourcePath: inputProperties.sourcePath,
|
|
51
52
|
collaborators: inputProperties.collaborators,
|
|
52
53
|
hasProjects: inputProperties.hasProjects,
|
|
@@ -88,7 +89,7 @@ function createPublishGithubAction(options) {
|
|
|
88
89
|
requiredConversationResolution = false,
|
|
89
90
|
requireLastPushApproval = false,
|
|
90
91
|
repoVisibility = "private",
|
|
91
|
-
defaultBranch = "
|
|
92
|
+
defaultBranch = "main",
|
|
92
93
|
protectDefaultBranch = true,
|
|
93
94
|
protectEnforceAdmins = true,
|
|
94
95
|
deleteBranchOnMerge = false,
|
|
@@ -101,6 +102,7 @@ function createPublishGithubAction(options) {
|
|
|
101
102
|
squashMergeCommitMessage = "COMMIT_MESSAGES",
|
|
102
103
|
allowRebaseMerge = true,
|
|
103
104
|
allowAutoMerge = false,
|
|
105
|
+
allowUpdateBranch = false,
|
|
104
106
|
collaborators,
|
|
105
107
|
hasProjects = void 0,
|
|
106
108
|
hasWiki = void 0,
|
|
@@ -145,6 +147,7 @@ function createPublishGithubAction(options) {
|
|
|
145
147
|
squashMergeCommitMessage,
|
|
146
148
|
allowRebaseMerge,
|
|
147
149
|
allowAutoMerge,
|
|
150
|
+
allowUpdateBranch,
|
|
148
151
|
access,
|
|
149
152
|
collaborators,
|
|
150
153
|
hasProjects,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.cjs.js","sources":["../../src/actions/github.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 { 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 initRepoPushAndProtect,\n} from './helpers';\nimport { getOctokitOptions } from '../util';\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 requiredLinearHistory?: boolean;\n customProperties?: { [key: string]: string };\n subscribe?: boolean;\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 requiredLinearHistory: inputProps.requiredLinearHistory,\n customProperties: inputProps.customProperties,\n subscribe: inputProps.subscribe,\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 subscribe = false,\n requiredCommitSigning = false,\n requiredLinearHistory = false,\n } = ctx.input;\n\n const { host, 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 host,\n owner,\n repo,\n });\n const client = new Octokit(octokitOptions);\n\n const { remoteUrl, repoContentsUrl } = await ctx.checkpoint({\n key: `create.github.repo.${owner}.${repo}`,\n fn: async () => {\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 subscribe,\n ctx.logger,\n );\n\n return {\n remoteUrl: newRepo.clone_url,\n repoContentsUrl: `${newRepo.html_url}/blob/${defaultBranch}`,\n };\n },\n });\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 requiredLinearHistory,\n );\n\n ctx.output('commitHash', commitResult?.commitHash);\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n },\n });\n}\n"],"names":["createTemplateAction","examples","inputProps.repoUrl","inputProps.description","inputProps.homepage","inputProps.access","inputProps.bypassPullRequestAllowances","inputProps.requiredApprovingReviewCount","inputProps.restrictions","inputProps.requireCodeOwnerReviews","inputProps.dismissStaleReviews","inputProps.requiredStatusCheckContexts","inputProps.requireBranchesToBeUpToDate","inputProps.requiredConversationResolution","inputProps.requireLastPushApproval","inputProps.repoVisibility","inputProps.defaultBranch","inputProps.protectDefaultBranch","inputProps.protectEnforceAdmins","inputProps.deleteBranchOnMerge","inputProps.gitCommitMessage","inputProps.gitAuthorName","inputProps.gitAuthorEmail","inputProps.allowMergeCommit","inputProps.allowSquashMerge","inputProps.squashMergeCommitTitle","inputProps.squashMergeCommitMessage","inputProps.allowRebaseMerge","inputProps.allowAutoMerge","inputProps.sourcePath","inputProps.collaborators","inputProps.hasProjects","inputProps.hasWiki","inputProps.hasIssues","inputProps.token","inputProps.topics","inputProps.repoVariables","inputProps.secrets","inputProps.oidcCustomization","inputProps.requiredCommitSigning","inputProps.requiredLinearHistory","inputProps.customProperties","inputProps.subscribe","outputProps.remoteUrl","outputProps.repoContentsUrl","outputProps.commitHash","parseRepoUrl","InputError","getOctokitOptions","Octokit","createGithubRepoWithCollaboratorsAndTopics","initRepoPushAndProtect"],"mappings":";;;;;;;;;;;AA0CO,SAAS,0BAA0B,OAIvC,EAAA;AACD,EAAA,MAAM,EAAE,YAAA,EAAc,MAAQ,EAAA,yBAAA,EAA8B,GAAA,OAAA;AAE5D,EAAA,OAAOA,yCAuEJ,CAAA;AAAA,IACD,EAAI,EAAA,gBAAA;AAAA,IACJ,WACE,EAAA,mFAAA;AAAA,cACFC,wBAAA;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,IAAM,EAAA,QAAA;AAAA,QACN,QAAA,EAAU,CAAC,SAAS,CAAA;AAAA,QACpB,UAAY,EAAA;AAAA,UACV,SAASC,uBAAW;AAAA,UACpB,aAAaC,2BAAW;AAAA,UACxB,UAAUC,wBAAW;AAAA,UACrB,QAAQC,sBAAW;AAAA,UACnB,6BAA6BC,2CAAW;AAAA,UACx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CAAA,IAAA;AAAA,QACf,GAAI,CAAA,aAAA;AAAA,QACJ,IAAI,KAAM,CAAA,UAAA;AAAA,QACV,aAAA;AAAA,QACA,oBAAA;AAAA,QACA,oBAAA;AAAA,QACA,KAAA;AAAA,QACA,MAAA;AAAA,QACA,IAAA;AAAA,QACA,uBAAA;AAAA,QACA,2BAAA;AAAA,QACA,4BAAA;AAAA,QACA,YAAA;AAAA,QACA,2BAAA;AAAA,QACA,2BAAA;AAAA,QACA,8BAAA;AAAA,QACA,uBAAA;AAAA,QACA,MAAA;AAAA,QACA,GAAI,CAAA,MAAA;AAAA,QACJ,gBAAA;AAAA,QACA,aAAA;AAAA,QACA,cAAA;AAAA,QACA,mBAAA;AAAA,QACA,qBAAA;AAAA,QACA;AAAA,OACF;AAEA,MAAI,GAAA,CAAA,MAAA,CAAO,YAAc,EAAA,YAAA,EAAc,UAAU,CAAA;AACjD,MAAI,GAAA,CAAA,MAAA,CAAO,aAAa,SAAS,CAAA;AACjC,MAAI,GAAA,CAAA,MAAA,CAAO,mBAAmB,eAAe,CAAA;AAAA;AAC/C,GACD,CAAA;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"github.cjs.js","sources":["../../src/actions/github.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 { 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 initRepoPushAndProtect,\n} from './helpers';\nimport { getOctokitOptions } from '../util';\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 allowUpdateBranch?: 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 requiredLinearHistory?: boolean;\n customProperties?: { [key: string]: string };\n subscribe?: boolean;\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 allowUpdateBranch: inputProps.allowUpdateBranch,\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 requiredLinearHistory: inputProps.requiredLinearHistory,\n customProperties: inputProps.customProperties,\n subscribe: inputProps.subscribe,\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 = 'main',\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 allowUpdateBranch = 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 subscribe = false,\n requiredCommitSigning = false,\n requiredLinearHistory = false,\n } = ctx.input;\n\n const { host, 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 host,\n owner,\n repo,\n });\n const client = new Octokit(octokitOptions);\n\n const { remoteUrl, repoContentsUrl } = await ctx.checkpoint({\n key: `create.github.repo.${owner}.${repo}`,\n fn: async () => {\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 allowUpdateBranch,\n access,\n collaborators,\n hasProjects,\n hasWiki,\n hasIssues,\n topics,\n repoVariables,\n secrets,\n oidcCustomization,\n customProperties,\n subscribe,\n ctx.logger,\n );\n\n return {\n remoteUrl: newRepo.clone_url,\n repoContentsUrl: `${newRepo.html_url}/blob/${defaultBranch}`,\n };\n },\n });\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 requiredLinearHistory,\n );\n\n ctx.output('commitHash', commitResult?.commitHash);\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n },\n });\n}\n"],"names":["createTemplateAction","examples","inputProps.repoUrl","inputProps.description","inputProps.homepage","inputProps.access","inputProps.bypassPullRequestAllowances","inputProps.requiredApprovingReviewCount","inputProps.restrictions","inputProps.requireCodeOwnerReviews","inputProps.dismissStaleReviews","inputProps.requiredStatusCheckContexts","inputProps.requireBranchesToBeUpToDate","inputProps.requiredConversationResolution","inputProps.requireLastPushApproval","inputProps.repoVisibility","inputProps.defaultBranch","inputProps.protectDefaultBranch","inputProps.protectEnforceAdmins","inputProps.deleteBranchOnMerge","inputProps.gitCommitMessage","inputProps.gitAuthorName","inputProps.gitAuthorEmail","inputProps.allowMergeCommit","inputProps.allowSquashMerge","inputProps.squashMergeCommitTitle","inputProps.squashMergeCommitMessage","inputProps.allowRebaseMerge","inputProps.allowAutoMerge","inputProps.allowUpdateBranch","inputProps.sourcePath","inputProps.collaborators","inputProps.hasProjects","inputProps.hasWiki","inputProps.hasIssues","inputProps.token","inputProps.topics","inputProps.repoVariables","inputProps.secrets","inputProps.oidcCustomization","inputProps.requiredCommitSigning","inputProps.requiredLinearHistory","inputProps.customProperties","inputProps.subscribe","outputProps.remoteUrl","outputProps.repoContentsUrl","outputProps.commitHash","parseRepoUrl","InputError","getOctokitOptions","Octokit","createGithubRepoWithCollaboratorsAndTopics","initRepoPushAndProtect"],"mappings":";;;;;;;;;;;AA0CO,SAAS,0BAA0B,OAIvC,EAAA;AACD,EAAA,MAAM,EAAE,YAAA,EAAc,MAAQ,EAAA,yBAAA,EAA8B,GAAA,OAAA;AAE5D,EAAA,OAAOA,yCAwEJ,CAAA;AAAA,IACD,EAAI,EAAA,gBAAA;AAAA,IACJ,WACE,EAAA,mFAAA;AAAA,cACFC,wBAAA;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,IAAM,EAAA,QAAA;AAAA,QACN,QAAA,EAAU,CAAC,SAAS,CAAA;AAAA,QACpB,UAAY,EAAA;AAAA,UACV,SAASC,uBAAW;AAAA,UACpB,aAAaC,2BAAW;AAAA,UACxB,UAAUC,wBAAW;AAAA,UACrB,QAAQC,sBAAW;AAAA,UACnB,6BAA6BC,2CAAW;AAAA,UACxC,8BAA8BC,4CAAW;AAAA,UACzC,cAAcC,4BAAW;AAAA,UACzB,yBAAyBC,uCAAW;AAAA,UACpC,qBAAqBC,mCAAW;AAAA,UAChC,6BAA6BC,2CAAW;AAAA,UACxC,6BAA6BC,2CAAW;AAAA,UACxC,gCACEC,8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ACA,oBAAA;AAAA,QACA,oBAAA;AAAA,QACA,KAAA;AAAA,QACA,MAAA;AAAA,QACA,IAAA;AAAA,QACA,uBAAA;AAAA,QACA,2BAAA;AAAA,QACA,4BAAA;AAAA,QACA,YAAA;AAAA,QACA,2BAAA;AAAA,QACA,2BAAA;AAAA,QACA,8BAAA;AAAA,QACA,uBAAA;AAAA,QACA,MAAA;AAAA,QACA,GAAI,CAAA,MAAA;AAAA,QACJ,gBAAA;AAAA,QACA,aAAA;AAAA,QACA,cAAA;AAAA,QACA,mBAAA;AAAA,QACA,qBAAA;AAAA,QACA;AAAA,OACF;AAEA,MAAI,GAAA,CAAA,MAAA,CAAO,YAAc,EAAA,YAAA,EAAc,UAAU,CAAA;AACjD,MAAI,GAAA,CAAA,MAAA,CAAO,aAAa,SAAS,CAAA;AACjC,MAAI,GAAA,CAAA,MAAA,CAAO,mBAAmB,eAAe,CAAA;AAAA;AAC/C,GACD,CAAA;AACH;;;;"}
|
|
@@ -85,19 +85,33 @@ function createGithubDeployKeyAction(options) {
|
|
|
85
85
|
repo
|
|
86
86
|
});
|
|
87
87
|
const client = new octokit.Octokit(octokitOptions);
|
|
88
|
-
await
|
|
89
|
-
owner
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
await ctx.checkpoint({
|
|
89
|
+
key: `create.deploy.key.${owner}.${repo}.${publicKey}`,
|
|
90
|
+
fn: async () => {
|
|
91
|
+
await client.rest.repos.createDeployKey({
|
|
92
|
+
owner,
|
|
93
|
+
repo,
|
|
94
|
+
title: deployKeyName,
|
|
95
|
+
key: publicKey
|
|
96
|
+
});
|
|
97
|
+
}
|
|
93
98
|
});
|
|
94
|
-
const
|
|
95
|
-
owner
|
|
96
|
-
|
|
99
|
+
const { key, keyId } = await ctx.checkpoint({
|
|
100
|
+
key: `get.repo.public.key.${owner}.${repo}`,
|
|
101
|
+
fn: async () => {
|
|
102
|
+
const publicKeyResponse = await client.rest.actions.getRepoPublicKey({
|
|
103
|
+
owner,
|
|
104
|
+
repo
|
|
105
|
+
});
|
|
106
|
+
return {
|
|
107
|
+
key: publicKeyResponse.data.key,
|
|
108
|
+
keyId: publicKeyResponse.data.key_id
|
|
109
|
+
};
|
|
110
|
+
}
|
|
97
111
|
});
|
|
98
112
|
await Sodium__default.default.ready;
|
|
99
113
|
const binaryKey = Sodium__default.default.from_base64(
|
|
100
|
-
|
|
114
|
+
key,
|
|
101
115
|
Sodium__default.default.base64_variants.ORIGINAL
|
|
102
116
|
);
|
|
103
117
|
const binarySecret = Sodium__default.default.from_string(privateKey);
|
|
@@ -109,12 +123,17 @@ function createGithubDeployKeyAction(options) {
|
|
|
109
123
|
encryptedBinarySecret,
|
|
110
124
|
Sodium__default.default.base64_variants.ORIGINAL
|
|
111
125
|
);
|
|
112
|
-
await
|
|
113
|
-
owner
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
126
|
+
await ctx.checkpoint({
|
|
127
|
+
key: `create.or.update.repo.secret.${owner}.${repo}.${keyId}`,
|
|
128
|
+
fn: async () => {
|
|
129
|
+
await client.rest.actions.createOrUpdateRepoSecret({
|
|
130
|
+
owner,
|
|
131
|
+
repo,
|
|
132
|
+
secret_name: privateKeySecretName,
|
|
133
|
+
encrypted_value: encryptedBase64Secret,
|
|
134
|
+
key_id: keyId
|
|
135
|
+
});
|
|
136
|
+
}
|
|
118
137
|
});
|
|
119
138
|
ctx.output("privateKeySecretName", privateKeySecretName);
|
|
120
139
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"githubDeployKey.cjs.js","sources":["../../src/actions/githubDeployKey.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 './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:\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 publicKey: {\n title: 'SSH Public Key',\n description:\n '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:\n '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 { 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\n await client.rest.repos.createDeployKey({\n
|
|
1
|
+
{"version":3,"file":"githubDeployKey.cjs.js","sources":["../../src/actions/githubDeployKey.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 './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:\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 publicKey: {\n title: 'SSH Public Key',\n description:\n '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:\n '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 { 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\n await ctx.checkpoint({\n key: `create.deploy.key.${owner}.${repo}.${publicKey}`,\n fn: async () => {\n await client.rest.repos.createDeployKey({\n owner: owner,\n repo: repo,\n title: deployKeyName,\n key: publicKey,\n });\n },\n });\n\n const { key, keyId } = await ctx.checkpoint({\n key: `get.repo.public.key.${owner}.${repo}`,\n fn: async () => {\n const publicKeyResponse = await client.rest.actions.getRepoPublicKey({\n owner: owner,\n repo: repo,\n });\n return {\n key: publicKeyResponse.data.key,\n keyId: publicKeyResponse.data.key_id,\n };\n },\n });\n\n await Sodium.ready;\n const binaryKey = Sodium.from_base64(\n 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 ctx.checkpoint({\n key: `create.or.update.repo.secret.${owner}.${repo}.${keyId}`,\n fn: async () => {\n await client.rest.actions.createOrUpdateRepoSecret({\n owner: owner,\n repo: repo,\n secret_name: privateKeySecretName,\n encrypted_value: encryptedBase64Secret,\n key_id: keyId,\n });\n },\n });\n\n ctx.output('privateKeySecretName', privateKeySecretName);\n },\n });\n}\n"],"names":["createTemplateAction","examples","parseRepoUrl","InputError","getOctokitOptions","Octokit","Sodium"],"mappings":";;;;;;;;;;;;;AAgCO,SAAS,4BAA4B,OAEzC,EAAA;AACD,EAAM,MAAA,EAAE,cAAiB,GAAA,OAAA;AAGzB,EAAA,OAAOA,yCAOJ,CAAA;AAAA,IACD,EAAI,EAAA,yBAAA;AAAA,IACJ,WAAa,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CAAK,QAAQ,gBAAiB,CAAA;AAAA,YACnE,KAAA;AAAA,YACA;AAAA,WACD,CAAA;AACD,UAAO,OAAA;AAAA,YACL,GAAA,EAAK,kBAAkB,IAAK,CAAA,GAAA;AAAA,YAC5B,KAAA,EAAO,kBAAkB,IAAK,CAAA;AAAA,WAChC;AAAA;AACF,OACD,CAAA;AAED,MAAA,MAAMC,uBAAO,CAAA,KAAA;AACb,MAAA,MAAM,YAAYA,uBAAO,CAAA,WAAA;AAAA,QACvB,GAAA;AAAA,QACAA,wBAAO,eAAgB,CAAA;AAAA,OACzB;AACA,MAAM,MAAA,YAAA,GAAeA,uBAAO,CAAA,WAAA,CAAY,UAAU,CAAA;AAClD,MAAA,MAAM,wBAAwBA,uBAAO,CAAA,eAAA;AAAA,QACnC,YAAA;AAAA,QACA;AAAA,OACF;AACA,MAAA,MAAM,wBAAwBA,uBAAO,CAAA,SAAA;AAAA,QACnC,qBAAA;AAAA,QACAA,wBAAO,eAAgB,CAAA;AAAA,OACzB;AAEA,MAAA,MAAM,IAAI,UAAW,CAAA;AAAA,QACnB,KAAK,CAAgC,6BAAA,EAAA,KAAK,CAAI,CAAA,EAAA,IAAI,IAAI,KAAK,CAAA,CAAA;AAAA,QAC3D,IAAI,YAAY;AACd,UAAM,MAAA,MAAA,CAAO,IAAK,CAAA,OAAA,CAAQ,wBAAyB,CAAA;AAAA,YACjD,KAAA;AAAA,YACA,IAAA;AAAA,YACA,WAAa,EAAA,oBAAA;AAAA,YACb,eAAiB,EAAA,qBAAA;AAAA,YACjB,MAAQ,EAAA;AAAA,WACT,CAAA;AAAA;AACH,OACD,CAAA;AAED,MAAI,GAAA,CAAA,MAAA,CAAO,wBAAwB,oBAAoB,CAAA;AAAA;AACzD,GACD,CAAA;AACH;;;;"}
|
|
@@ -39,6 +39,7 @@ function createGithubRepoCreateAction(options) {
|
|
|
39
39
|
squashMergeCommitMessage: inputProperties.squashMergeCommitMessage,
|
|
40
40
|
allowRebaseMerge: inputProperties.allowRebaseMerge,
|
|
41
41
|
allowAutoMerge: inputProperties.allowAutoMerge,
|
|
42
|
+
allowUpdateBranch: inputProperties.allowUpdateBranch,
|
|
42
43
|
collaborators: inputProperties.collaborators,
|
|
43
44
|
hasProjects: inputProperties.hasProjects,
|
|
44
45
|
hasWiki: inputProperties.hasWiki,
|
|
@@ -76,6 +77,7 @@ function createGithubRepoCreateAction(options) {
|
|
|
76
77
|
squashMergeCommitMessage = "COMMIT_MESSAGES",
|
|
77
78
|
allowRebaseMerge = true,
|
|
78
79
|
allowAutoMerge = false,
|
|
80
|
+
allowUpdateBranch = false,
|
|
79
81
|
collaborators,
|
|
80
82
|
hasProjects = void 0,
|
|
81
83
|
hasWiki = void 0,
|
|
@@ -118,6 +120,7 @@ function createGithubRepoCreateAction(options) {
|
|
|
118
120
|
squashMergeCommitMessage,
|
|
119
121
|
allowRebaseMerge,
|
|
120
122
|
allowAutoMerge,
|
|
123
|
+
allowUpdateBranch,
|
|
121
124
|
access,
|
|
122
125
|
collaborators,
|
|
123
126
|
hasProjects,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"githubRepoCreate.cjs.js","sources":["../../src/actions/githubRepoCreate.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 GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport { Octokit } from 'octokit';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { createGithubRepoWithCollaboratorsAndTopics } from './helpers';\nimport { getOctokitOptions } from '../util';\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 requiredLinearHistory?: boolean;\n customProperties?: { [key: string]: string };\n subscribe?: boolean;\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 requiredLinearHistory: inputProps.requiredLinearHistory,\n customProperties: inputProps.customProperties,\n subscribe: inputProps.subscribe,\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 subscribe,\n token: providedToken,\n } = ctx.input;\n\n const { host, 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 host,\n owner,\n repo,\n });\n const client = new Octokit(octokitOptions);\n\n const remoteUrl = await ctx.checkpoint({\n key: `create.repo.and.topics.${owner}.${repo}`,\n fn: async () => {\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 subscribe,\n ctx.logger,\n );\n return newRepo.clone_url;\n },\n });\n\n ctx.output('remoteUrl', remoteUrl);\n },\n });\n}\n"],"names":["createTemplateAction","examples","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.requiredLinearHistory","inputProps.customProperties","inputProps.subscribe","outputProps.remoteUrl","outputProps.repoContentsUrl","parseRepoUrl","InputError","getOctokitOptions","Octokit","createGithubRepoWithCollaboratorsAndTopics"],"mappings":";;;;;;;;;;;AAqCO,SAAS,6BAA6B,OAG1C,EAAA;AACD,EAAM,MAAA,EAAE,YAAc,EAAA,yBAAA,EAA8B,GAAA,OAAA;AAEpD,EAAA,OAAOA,yCA4DJ,CAAA;AAAA,IACD,EAAI,EAAA,oBAAA;AAAA,IACJ,WAAa,EAAA,8BAAA;AAAA,cACbC,kCAAA;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,IAAM,EAAA,QAAA;AAAA,QACN,QAAA,EAAU,CAAC,SAAS,CAAA;AAAA,QACpB,UAAY,EAAA;AAAA,UACV,SAASC,uBAAW;AAAA,UACpB,aAAaC,2BAAW;AAAA,UACxB,UAAUC,wBAAW;AAAA,UACrB,QAAQC,sBAAW;AAAA,UACnB,yBAAyBC,uCAAW;AAAA,UACpC,6BAA6BC,2CAAW;AAAA,UACxC,8BAA8BC,4CAAW;AAAA,UACzC,cAAcC,4BAAW;AAAA,UACzB,6BAA6BC,2CAAW;AAAA,UACxC,6BAA6BC,2CAAW;AAAA,UACxC,gCACEC,8CAAW;AAAA,UACb,gBAAgBC,8BAAW;AAAA,UAC3B,qBAAqBC,mCAAW;AAAA,UAChC,kBAAkBC,gCAAW;AAAA,UAC7B,kBAAkBC,gCAAW;AAAA,UAC7B,wBAAwBC,sCAAW;AAAA,UACnC,0BAA0BC,wCAAW;AAAA,UACrC,kBAAkBC,gCAAW;AAAA,UAC7B,gBAAgBC,8BAAW;AAAA,UAC3B,eAAeC,6BAAW;AAAA,UAC1B,aAAaC,2BAAW;AAAA,UACxB,SAASC,uBAAW;AAAA,UACpB,WAAWC,yBAAW;AAAA,UACtB,OAAOC,qBAAW;AAAA,UAClB,QAAQC,sBAAW;AAAA,UACnB,eAAeC,6BAAW;AAAA,UAC1B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AA,QACA,mBAAqB,EAAA,yBAAA;AAAA,QACrB,KAAO,EAAA,aAAA;AAAA,QACP,IAAA;AAAA,QACA,KAAA;AAAA,QACA;AAAA,OACD,CAAA;AACD,MAAM,MAAA,MAAA,GAAS,IAAIC,eAAA,CAAQ,cAAc,CAAA;AAEzC,MAAM,MAAA,SAAA,GAAY,MAAM,GAAA,CAAI,UAAW,CAAA;AAAA,QACrC,GAAK,EAAA,CAAA,uBAAA,EAA0B,KAAK,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA;AAAA,QAC5C,IAAI,YAAY;AACd,UAAA,MAAM,UAAU,MAAMC,kDAAA;AAAA,YACpB,MAAA;AAAA,YACA,IAAA;AAAA,YACA,KAAA;AAAA,YACA,cAAA;AAAA,YACA,WAAA;AAAA,YACA,QAAA;AAAA,YACA,mBAAA;AAAA,YACA,gBAAA;AAAA,YACA,gBAAA;AAAA,YACA,sBAAA;AAAA,YACA,wBAAA;AAAA,YACA,gBAAA;AAAA,YACA,cAAA;AAAA,YACA,MAAA;AAAA,YACA,aAAA;AAAA,YACA,WAAA;AAAA,YACA,OAAA;AAAA,YACA,SAAA;AAAA,YACA,MAAA;AAAA,YACA,aAAA;AAAA,YACA,OAAA;AAAA,YACA,iBAAA;AAAA,YACA,gBAAA;AAAA,YACA,SAAA;AAAA,YACA,GAAI,CAAA;AAAA,WACN;AACA,UAAA,OAAO,OAAQ,CAAA,SAAA;AAAA;AACjB,OACD,CAAA;AAED,MAAI,GAAA,CAAA,MAAA,CAAO,aAAa,SAAS,CAAA;AAAA;AACnC,GACD,CAAA;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"githubRepoCreate.cjs.js","sources":["../../src/actions/githubRepoCreate.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 GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport { Octokit } from 'octokit';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { createGithubRepoWithCollaboratorsAndTopics } from './helpers';\nimport { getOctokitOptions } from '../util';\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 allowUpdateBranch?: 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 requiredLinearHistory?: boolean;\n customProperties?: { [key: string]: string };\n subscribe?: boolean;\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 allowUpdateBranch: inputProps.allowUpdateBranch,\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 requiredLinearHistory: inputProps.requiredLinearHistory,\n customProperties: inputProps.customProperties,\n subscribe: inputProps.subscribe,\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 allowUpdateBranch = false,\n collaborators,\n hasProjects = undefined,\n hasWiki = undefined,\n hasIssues = undefined,\n topics,\n repoVariables,\n secrets,\n oidcCustomization,\n customProperties,\n subscribe,\n token: providedToken,\n } = ctx.input;\n\n const { host, 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 host,\n owner,\n repo,\n });\n const client = new Octokit(octokitOptions);\n\n const remoteUrl = await ctx.checkpoint({\n key: `create.repo.and.topics.${owner}.${repo}`,\n fn: async () => {\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 allowUpdateBranch,\n access,\n collaborators,\n hasProjects,\n hasWiki,\n hasIssues,\n topics,\n repoVariables,\n secrets,\n oidcCustomization,\n customProperties,\n subscribe,\n ctx.logger,\n );\n return newRepo.clone_url;\n },\n });\n\n ctx.output('remoteUrl', remoteUrl);\n },\n });\n}\n"],"names":["createTemplateAction","examples","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.allowUpdateBranch","inputProps.collaborators","inputProps.hasProjects","inputProps.hasWiki","inputProps.hasIssues","inputProps.token","inputProps.topics","inputProps.repoVariables","inputProps.secrets","inputProps.oidcCustomization","inputProps.requiredCommitSigning","inputProps.requiredLinearHistory","inputProps.customProperties","inputProps.subscribe","outputProps.remoteUrl","outputProps.repoContentsUrl","parseRepoUrl","InputError","getOctokitOptions","Octokit","createGithubRepoWithCollaboratorsAndTopics"],"mappings":";;;;;;;;;;;AAqCO,SAAS,6BAA6B,OAG1C,EAAA;AACD,EAAM,MAAA,EAAE,YAAc,EAAA,yBAAA,EAA8B,GAAA,OAAA;AAEpD,EAAA,OAAOA,yCA6DJ,CAAA;AAAA,IACD,EAAI,EAAA,oBAAA;AAAA,IACJ,WAAa,EAAA,8BAAA;AAAA,cACbC,kCAAA;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,IAAM,EAAA,QAAA;AAAA,QACN,QAAA,EAAU,CAAC,SAAS,CAAA;AAAA,QACpB,UAAY,EAAA;AAAA,UACV,SAASC,uBAAW;AAAA,UACpB,aAAaC,2BAAW;AAAA,UACxB,UAAUC,wBAAW;AAAA,UACrB,QAAQC,sBAAW;AAAA,UACnB,yBAAyBC,uCAAW;AAAA,UACpC,6BAA6BC,2CAAW;AAAA,UACxC,8BAA8BC,4CAAW;AAAA,UACzC,cAAcC,4BAAW;AAAA,UACzB,6BAA6BC,2CAAW;AAAA,UACxC,6BAA6BC,2CAAW;AAAA,UACxC,gCACEC,8CAAW;AAAA,UACb,gB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,aAAA;AAAA,YACA,OAAA;AAAA,YACA,iBAAA;AAAA,YACA,gBAAA;AAAA,YACA,SAAA;AAAA,YACA,GAAI,CAAA;AAAA,WACN;AACA,UAAA,OAAO,OAAQ,CAAA,SAAA;AAAA;AACjB,OACD,CAAA;AAED,MAAI,GAAA,CAAA,MAAA,CAAO,aAAa,SAAS,CAAA;AAAA;AACnC,GACD,CAAA;AACH;;;;"}
|
|
@@ -957,6 +957,21 @@ const examples = [
|
|
|
957
957
|
}
|
|
958
958
|
]
|
|
959
959
|
})
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
description: "Allow branch updates.",
|
|
963
|
+
example: yaml__default.default.stringify({
|
|
964
|
+
steps: [
|
|
965
|
+
{
|
|
966
|
+
action: "github:repo:create",
|
|
967
|
+
name: "Create a new GitHub repository allowing branch updates",
|
|
968
|
+
input: {
|
|
969
|
+
repoUrl: "github.com?repo=repo&owner=owner",
|
|
970
|
+
allowUpdateBranch: true
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
]
|
|
974
|
+
})
|
|
960
975
|
}
|
|
961
976
|
];
|
|
962
977
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"githubRepoCreate.examples.cjs.js","sources":["../../src/actions/githubRepoCreate.examples.ts"],"sourcesContent":["/*\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"],"names":["yaml"],"mappings":";;;;;;;;AAmBO,MAAM,QAA8B,GAAA;AAAA,EACzC;AAAA,IACE,WAAa,EAAA,yDAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,MAAQ,EAAA,oBAAA;AAAA,UACR,IAAM,EAAA,gCAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA;AAAA;AACX;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAa,EAAA,oBAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,MAAQ,EAAA,oBAAA;AAAA,UACR,IAAM,EAAA,mD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+
{"version":3,"file":"githubRepoCreate.examples.cjs.js","sources":["../../src/actions/githubRepoCreate.examples.ts"],"sourcesContent":["/*\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 description: 'Allow branch updates.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository allowing branch updates',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n allowUpdateBranch: true,\n },\n },\n ],\n }),\n },\n];\n"],"names":["yaml"],"mappings":";;;;;;;;AAmBO,MAAM,QAA8B,GAAA;AAAA,EACzC;AAAA,IACE,WAAa,EAAA,yDAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,MAAQ,EAAA,oBAAA;AAAA,UACR,IAAM,EAAA,gCAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA;AAAA;AACX;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAa,EAAA,oBAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,MAAQ,EAAA,oBAAA;AAAA,UACR,IAAM,EAAA,mDAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA,kCAAA;AAAA,YACT,WAAa,EAAA;AAAA;AACf;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAa,EAAA,0BAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,MAAQ,EAAA,oBAAA;AAAA,UACR,IAAM,EAAA,wDAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA,kCAAA;AAAA,YACT,SAAW,EAAA,KAAA;AAAA,YACX,OAAS,EAAA;AAAA;AACX;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAa,EAAA,0BAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,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,EAAM,YAAc,EAAA,KAAA,EAAO,aAAc,EAAA;AAAA,cAC3C,EAAE,IAAA,EAAM,SAAW,EAAA,KAAA,EAAO,QAAS;AAAA,aACrC;AAAA,YACA,aAAe,EAAA;AAAA,cACb,EAAE,QAAA,EAAU,MAAQ,EAAA,UAAA,EAAY,OAAQ,EAAA;AAAA,cACxC,EAAE,QAAA,EAAU,MAAQ,EAAA,UAAA,EAAY,MAAO;AAAA;AACzC;AACF;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WACE,EAAA,+EAAA;AAAA,IACF,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,MAAQ,EAAA,oBAAA;AAAA,UACR,IAAM,EAAA,2GAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA,kCAAA;AAAA,YACT,2BAAA,EAA6B,CAAC,UAAU,CAAA;AAAA,YACxC,8BAAgC,EAAA;AAAA;AAClC;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAa,EAAA,uBAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,MAAQ,EAAA,oBAAA;AAAA,UACR,IAAM,EAAA,wDAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA,kCAAA;AAAA,YACT,iBAAmB,EAAA;AAAA;AACrB;AACF;AACF,KACD;AAAA;AAEL;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"githubRepoPush.cjs.js","sources":["../../src/actions/githubRepoPush.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 { 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 { initRepoPushAndProtect } from './helpers';\nimport { getOctokitOptions } from '../util';\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 requiredLinearHistory?: 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 requiredLinearHistory: inputProps.requiredLinearHistory,\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 requiredLinearHistory = false,\n } = ctx.input;\n\n const { host, 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 host,\n owner,\n repo,\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 ctx.checkpoint({\n key: `init.repo.publish.${owner}.${client}.${repo}`,\n fn: async () => {\n const { commitHash: hash } = 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 requiredLinearHistory,\n );\n return hash;\n },\n });\n\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n ctx.output('commitHash', commitHash);\n },\n });\n}\n"],"names":["createTemplateAction","examples","inputProps.repoUrl","inputProps.requireCodeOwnerReviews","inputProps.dismissStaleReviews","inputProps.requiredStatusCheckContexts","inputProps.bypassPullRequestAllowances","inputProps.requiredApprovingReviewCount","inputProps.restrictions","inputProps.requireBranchesToBeUpToDate","inputProps.requiredConversationResolution","inputProps.requireLastPushApproval","inputProps.defaultBranch","inputProps.protectDefaultBranch","inputProps.protectEnforceAdmins","inputProps.gitCommitMessage","inputProps.gitAuthorName","inputProps.gitAuthorEmail","inputProps.sourcePath","inputProps.token","inputProps.requiredCommitSigning","inputProps.requiredLinearHistory","outputProps.remoteUrl","outputProps.repoContentsUrl","outputProps.commitHash","parseRepoUrl","InputError","getOctokitOptions","Octokit","initRepoPushAndProtect"],"mappings":";;;;;;;;;;;AAuCO,SAAS,2BAA2B,OAIxC,EAAA;AACD,EAAA,MAAM,EA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AAA,EAAA,KAAK,CAAI,CAAA,EAAA,MAAM,IAAI,IAAI,CAAA,CAAA;AAAA,QACjD,IAAI,YAAY;AACd,UAAA,MAAM,EAAE,UAAA,EAAY,IAAK,EAAA,GAAI,MAAMC,8BAAA;AAAA,YACjC,SAAA;AAAA,YACA,cAAe,CAAA,IAAA;AAAA,YACf,GAAI,CAAA,aAAA;AAAA,YACJ,IAAI,KAAM,CAAA,UAAA;AAAA,YACV,aAAA;AAAA,YACA,oBAAA;AAAA,YACA,oBAAA;AAAA,YACA,KAAA;AAAA,YACA,MAAA;AAAA,YACA,IAAA;AAAA,YACA,uBAAA;AAAA,YACA,2BAAA;AAAA,YACA,4BAAA;AAAA,YACA,YAAA;AAAA,YACA,2BAAA;AAAA,YACA,2BAAA;AAAA,YACA,8BAAA;AAAA,YACA,uBAAA;AAAA,YACA,MAAA;AAAA,YACA,GAAI,CAAA,MAAA;AAAA,YACJ,gBAAA;AAAA,YACA,aAAA;AAAA,YACA,cAAA;AAAA,YACA,mBAAA;AAAA,YACA,qBAAA;AAAA,YACA;AAAA,WACF;AACA,UAAO,OAAA,IAAA;AAAA;AACT,OACD,CAAA;AAED,MAAI,GAAA,CAAA,MAAA,CAAO,aAAa,SAAS,CAAA;AACjC,MAAI,GAAA,CAAA,MAAA,CAAO,mBAAmB,eAAe,CAAA;AAC7C,MAAI,GAAA,CAAA,MAAA,CAAO,cAAc,UAAU,CAAA;AAAA;AACrC,GACD,CAAA;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"githubRepoPush.cjs.js","sources":["../../src/actions/githubRepoPush.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 { 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 { initRepoPushAndProtect } from './helpers';\nimport { getOctokitOptions } from '../util';\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 requiredLinearHistory?: 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 requiredLinearHistory: inputProps.requiredLinearHistory,\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 = 'main',\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 requiredLinearHistory = false,\n } = ctx.input;\n\n const { host, 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 host,\n owner,\n repo,\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 ctx.checkpoint({\n key: `init.repo.publish.${owner}.${client}.${repo}`,\n fn: async () => {\n const { commitHash: hash } = 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 requiredLinearHistory,\n );\n return hash;\n },\n });\n\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n ctx.output('commitHash', commitHash);\n },\n });\n}\n"],"names":["createTemplateAction","examples","inputProps.repoUrl","inputProps.requireCodeOwnerReviews","inputProps.dismissStaleReviews","inputProps.requiredStatusCheckContexts","inputProps.bypassPullRequestAllowances","inputProps.requiredApprovingReviewCount","inputProps.restrictions","inputProps.requireBranchesToBeUpToDate","inputProps.requiredConversationResolution","inputProps.requireLastPushApproval","inputProps.defaultBranch","inputProps.protectDefaultBranch","inputProps.protectEnforceAdmins","inputProps.gitCommitMessage","inputProps.gitAuthorName","inputProps.gitAuthorEmail","inputProps.sourcePath","inputProps.token","inputProps.requiredCommitSigning","inputProps.requiredLinearHistory","outputProps.remoteUrl","outputProps.repoContentsUrl","outputProps.commitHash","parseRepoUrl","InputError","getOctokitOptions","Octokit","initRepoPushAndProtect"],"mappings":";;;;;;;;;;;AAuCO,SAAS,2BAA2B,OAIxC,EAAA;AACD,EAAA,MAAM,EAAE,YAAA,EAAc,MAAQ,EAAA,yBAAA,EAA8B,GAAA,OAAA;AA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,CAAA;AAAA,QACjD,IAAI,YAAY;AACd,UAAA,MAAM,EAAE,UAAA,EAAY,IAAK,EAAA,GAAI,MAAMC,8BAAA;AAAA,YACjC,SAAA;AAAA,YACA,cAAe,CAAA,IAAA;AAAA,YACf,GAAI,CAAA,aAAA;AAAA,YACJ,IAAI,KAAM,CAAA,UAAA;AAAA,YACV,aAAA;AAAA,YACA,oBAAA;AAAA,YACA,oBAAA;AAAA,YACA,KAAA;AAAA,YACA,MAAA;AAAA,YACA,IAAA;AAAA,YACA,uBAAA;AAAA,YACA,2BAAA;AAAA,YACA,4BAAA;AAAA,YACA,YAAA;AAAA,YACA,2BAAA;AAAA,YACA,2BAAA;AAAA,YACA,8BAAA;AAAA,YACA,uBAAA;AAAA,YACA,MAAA;AAAA,YACA,GAAI,CAAA,MAAA;AAAA,YACJ,gBAAA;AAAA,YACA,aAAA;AAAA,YACA,cAAA;AAAA,YACA,mBAAA;AAAA,YACA,qBAAA;AAAA,YACA;AAAA,WACF;AACA,UAAO,OAAA,IAAA;AAAA;AACT,OACD,CAAA;AAED,MAAI,GAAA,CAAA,MAAA,CAAO,aAAa,SAAS,CAAA;AACjC,MAAI,GAAA,CAAA,MAAA,CAAO,mBAAmB,eAAe,CAAA;AAC7C,MAAI,GAAA,CAAA,MAAA,CAAO,cAAc,UAAU,CAAA;AAAA;AACrC,GACD,CAAA;AACH;;;;"}
|
|
@@ -9,7 +9,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
9
9
|
|
|
10
10
|
var Sodium__default = /*#__PURE__*/_interopDefaultCompat(Sodium);
|
|
11
11
|
|
|
12
|
-
async function createGithubRepoWithCollaboratorsAndTopics(client, repo, owner, repoVisibility, description, homepage, deleteBranchOnMerge, allowMergeCommit, allowSquashMerge, squashMergeCommitTitle, squashMergeCommitMessage, allowRebaseMerge, allowAutoMerge, access, collaborators, hasProjects, hasWiki, hasIssues, topics, repoVariables, secrets, oidcCustomization, customProperties, subscribe, logger) {
|
|
12
|
+
async function createGithubRepoWithCollaboratorsAndTopics(client, repo, owner, repoVisibility, description, homepage, deleteBranchOnMerge, allowMergeCommit, allowSquashMerge, squashMergeCommitTitle, squashMergeCommitMessage, allowRebaseMerge, allowAutoMerge, allowUpdateBranch, access, collaborators, hasProjects, hasWiki, hasIssues, topics, repoVariables, secrets, oidcCustomization, customProperties, subscribe, logger) {
|
|
13
13
|
const user = await client.rest.users.getByUsername({
|
|
14
14
|
username: owner
|
|
15
15
|
});
|
|
@@ -30,6 +30,7 @@ async function createGithubRepoWithCollaboratorsAndTopics(client, repo, owner, r
|
|
|
30
30
|
squash_merge_commit_message: squashMergeCommitMessage,
|
|
31
31
|
allow_rebase_merge: allowRebaseMerge,
|
|
32
32
|
allow_auto_merge: allowAutoMerge,
|
|
33
|
+
allow_update_branch: allowUpdateBranch,
|
|
33
34
|
homepage,
|
|
34
35
|
has_projects: hasProjects,
|
|
35
36
|
has_wiki: hasWiki,
|
|
@@ -47,6 +48,7 @@ async function createGithubRepoWithCollaboratorsAndTopics(client, repo, owner, r
|
|
|
47
48
|
squash_merge_commit_message: squashMergeCommitMessage,
|
|
48
49
|
allow_rebase_merge: allowRebaseMerge,
|
|
49
50
|
allow_auto_merge: allowAutoMerge,
|
|
51
|
+
allow_update_branch: allowUpdateBranch,
|
|
50
52
|
homepage,
|
|
51
53
|
has_projects: hasProjects,
|
|
52
54
|
has_wiki: hasWiki,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.cjs.js","sources":["../../src/actions/helpers.ts"],"sourcesContent":["/*\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, NotFoundError } from '@backstage/errors';\nimport { Octokit } from 'octokit';\n\nimport {\n getRepoSourceDirectory,\n initRepoAndPush,\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\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 subscribe: boolean | 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 if (subscribe) {\n await client.rest.activity.setRepoSubscription({\n subscribed: true,\n ignored: false,\n owner,\n repo,\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 requiredLinearHistory?: 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 requiredLinearHistory: requiredLinearHistory,\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"],"names":["assertError","entityRefToName","Sodium","initRepoAndPush","getRepoSourceDirectory","enableBranchProtectionOnDefaultRepoBranch","NotFoundError"],"mappings":";;;;;;;;;;;AAgCsB,eAAA,0CAAA,CACpB,MACA,EAAA,IAAA,EACA,KACA,EAAA,cAAA,EACA,aACA,QACA,EAAA,mBAAA,EACA,gBACA,EAAA,gBAAA,EACA,sBACA,EAAA,wBAAA,EACA,kBACA,cACA,EAAA,MAAA,EACA,aAiBA,EAAA,WAAA,EACA,OACA,EAAA,SAAA,EACA,MACA,EAAA,aAAA,EACA,OACA,EAAA,iBAAA,EAMA,gBACA,EAAA,SAAA,EACA,MACA,EAAA;AAEA,EAAA,MAAM,IAAO,GAAA,MAAM,MAAO,CAAA,IAAA,CAAK,MAAM,aAAc,CAAA;AAAA,IACjD,QAAU,EAAA;AAAA,GACX,CAAA;AAED,EAAA,IAAI,MAAQ,EAAA,UAAA,CAAW,CAAG,EAAA,KAAK,GAAG,CAAG,EAAA;AACnC,IAAM,MAAA,kBAAA,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AI,CAAE,CAAA,QAAA,CAAS,IAAK,CAAA,OAAA,KAAY,WAAa,EAAA;AAC3C,MAAA,MAAM,OAAU,GAAA,CAAA;AAAA,QACZ,EAAA,GAAG,aAAa,SAAS,CAAA,6BAAA,CAAA;AAC7B,MAAM,MAAA,IAAIM,qBAAc,OAAO,CAAA;AAAA;AACjC;AAEJ;AAEgB,SAAA,mBAAA,CACd,kBACA,MACoB,EAAA;AACpB,EAAA,OAAO,gBACH,GAAA,gBAAA,GACA,MAAO,CAAA,iBAAA,CAAkB,iCAAiC,CAAA;AAChE;;;;;;"}
|
|
1
|
+
{"version":3,"file":"helpers.cjs.js","sources":["../../src/actions/helpers.ts"],"sourcesContent":["/*\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, NotFoundError } from '@backstage/errors';\nimport { Octokit } from 'octokit';\n\nimport {\n getRepoSourceDirectory,\n initRepoAndPush,\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\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 allowUpdateBranch: 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 subscribe: boolean | 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 allow_update_branch: allowUpdateBranch,\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 allow_update_branch: allowUpdateBranch,\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 if (subscribe) {\n await client.rest.activity.setRepoSubscription({\n subscribed: true,\n ignored: false,\n owner,\n repo,\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 requiredLinearHistory?: 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 requiredLinearHistory: requiredLinearHistory,\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"],"names":["assertError","entityRefToName","Sodium","initRepoAndPush","getRepoSourceDirectory","enableBranchProtectionOnDefaultRepoBranch","NotFoundError"],"mappings":";;;;;;;;;;;AAgCsB,eAAA,0CAAA,CACpB,MACA,EAAA,IAAA,EACA,KACA,EAAA,cAAA,EACA,WACA,EAAA,QAAA,EACA,mBACA,EAAA,gBAAA,EACA,gBACA,EAAA,sBAAA,EACA,wBACA,EAAA,gBAAA,EACA,gBACA,iBACA,EAAA,MAAA,EACA,aAiBA,EAAA,WAAA,EACA,OACA,EAAA,SAAA,EACA,MACA,EAAA,aAAA,EACA,OACA,EAAA,iBAAA,EAMA,gBACA,EAAA,SAAA,EACA,MACA,EAAA;AAEA,EAAA,MAAM,IAAO,GAAA,MAAM,MAAO,CAAA,IAAA,CAAK,MAAM,aAAc,CAAA;AAAA,IACjD,QAAU,EAAA;AAAA,GACX,CAAA;AAED,EAAA,IAAI,MAAQ,EAAA,UAAA,CAAW,CAAG,EAAA,KAAK,GAAG,CAAG,EAAA;AACnC,IAAM,MAAA,kBAAA,CAAmB,QAAQ,MAAM,CAAA;AAAA;AAGzC,EAAM,MAAA,mBAAA,GACJ,KAAK,IAAK,CAAA,IAAA,KAAS,iBACf,MAAO,CAAA,IAAA,CAAK,MAAM,WAAY,CAAA;AAAA,IAC5B,IAAM,EAAA,IAAA;AAAA,IACN,GAAK,EAAA,KAAA;AAAA,IACL,SAAS,cAAmB,KAAA,SAAA;AAAA;AAAA,IAE5B,UAAY,EAAA,cAAA;AAAA,IACZ,WAAA;AAAA,IACA,sBAAwB,EAAA,mBAAA;AAAA,IACxB,kBAAoB,EAAA,gBAAA;AAAA,IACpB,kBAAoB,EAAA,gBAAA;AAAA,IACpB,yBAA2B,EAAA,sBAAA;AAAA,IAC3B,2BAA6B,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 @@ const allowSquashMerge = {
|
|
|
87
87
|
default: true,
|
|
88
88
|
description: "Allow squash merges. The default value is `true`"
|
|
89
89
|
};
|
|
90
|
+
const allowUpdateBranch = {
|
|
91
|
+
title: "Allow Update Branch",
|
|
92
|
+
type: "boolean",
|
|
93
|
+
default: false,
|
|
94
|
+
description: "Allow branch to be updated. The default value is `false`"
|
|
95
|
+
};
|
|
90
96
|
const squashMergeCommitTitle = {
|
|
91
97
|
title: "Default squash merge commit title",
|
|
92
98
|
enum: ["PR_TITLE", "COMMIT_OR_PR_TITLE"],
|
|
@@ -310,6 +316,7 @@ exports.allowAutoMerge = allowAutoMerge;
|
|
|
310
316
|
exports.allowMergeCommit = allowMergeCommit;
|
|
311
317
|
exports.allowRebaseMerge = allowRebaseMerge;
|
|
312
318
|
exports.allowSquashMerge = allowSquashMerge;
|
|
319
|
+
exports.allowUpdateBranch = allowUpdateBranch;
|
|
313
320
|
exports.bypassPullRequestAllowances = bypassPullRequestAllowances;
|
|
314
321
|
exports.collaborators = collaborators;
|
|
315
322
|
exports.customProperties = customProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputProperties.cjs.js","sources":["../../src/actions/inputProperties.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\nconst 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};\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:\n '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:\n 'Require branches to be up to date before merging. The default value is `true`',\n type: 'boolean',\n default: true,\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 default: false,\n description:\n '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 default: false,\n description:\n 'Delete the branch after merging the PR. The default value is `false`',\n};\nconst gitAuthorName = {\n title: 'Default Author Name',\n type: 'string',\n default: 'Scaffolder',\n description:\n '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 default: true,\n description: 'Allow merge commits. The default value is `true`',\n};\nconst allowSquashMerge = {\n title: 'Allow Squash Merges',\n type: 'boolean',\n default: true,\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 type: 'string',\n default: 'COMMIT_OR_PR_TITLE',\n description:\n '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 type: 'string',\n default: 'COMMIT_MESSAGES',\n description:\n '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 default: true,\n description: 'Allow rebase merges. The default value is `true`',\n};\nconst allowAutoMerge = {\n title: 'Allow Auto Merges',\n type: 'boolean',\n default: false,\n description:\n '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:\n '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 default: true,\n description:\n 'Enable the wiki for the repository. The default value is `true`',\n};\nconst hasIssues = {\n title: 'Enable issues',\n type: 'boolean',\n default: true,\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 default: 'master',\n description:\n 'Sets the default branch on the repository. The default value is `master`',\n};\nconst protectDefaultBranch = {\n title: 'Protect Default Branch',\n type: 'boolean',\n default: true,\n description:\n '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 default: true,\n description:\n '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 default: 'initial commit',\n description:\n '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:\n '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 requiredLinearHistory = {\n title: 'Require linear history',\n type: 'boolean',\n description: `Prevent merge commits from being pushed to matching branches.`,\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\nconst subscribe = {\n title: 'Subscribe to repository',\n description: `Subscribe to the repository. The default value is 'false'`,\n type: 'boolean',\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 { requiredLinearHistory };\nexport { repoVariables };\nexport { secrets };\nexport { oidcCustomization };\nexport { customProperties };\nexport { subscribe };\n"],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,EAAA,sBAAA;AAAA,EACP,WAAa,EAAA,CAAA,oCAAA,CAAA;AAAA,EACb,IAAM,EAAA;AACR;AAEA,MAAM,OAAU,GAAA;AAAA,EACd,KAAO,EAAA,oBAAA;AAAA,EACP,WAAa,EAAA,CAAA,kCAAA,CAAA;AAAA,EACb,IAAM,EAAA;AACR;AAEA,MAAM,iBAAoB,GAAA;AAAA,EACxB,KAAO,EAAA,wCAAA;AAAA,EACP,WAAa,EAAA,CAAA,uDAAA,CAAA;AAAA,EACb,IAAM,EAAA,QAAA;AAAA,EACN,oBAAsB,EAAA,KAAA;AAAA,EACtB,UAAY,EAAA;AAAA,IACV,UAAY,EAAA;AAAA,MACV,KAAO,EAAA,aAAA;AAAA,MACP,IAAM,EAAA,SAAA;AAAA,MACN,WAAa,EAAA,CAAA,gDAAA;AAAA,KACf;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,KAAO,EAAA,oBAAA;AAAA,MACP,IAAM,EAAA,OAAA;AAAA,MACN,KAAO,EAAA;AAAA,QACL,IAAM,EAAA;AAAA,OACR;AAAA,MACA,WAAa,EAAA,CAAA,iGAAA;AAAA;AACf;AAEJ;AAEA,MAAM,gBAAmB,GAAA;AAAA,EACvB,KAAO,EAAA,8BAAA;AAAA,EACP,WACE,EAAA,uGAAA;AAAA,EACF,IAAM,EAAA;AACR;AAEA,MAAM,SAAY,GAAA;AAAA,EAChB,KAAO,EAAA,yBAAA;AAAA,EACP,WAAa,EAAA,CAAA,yDAAA,CAAA;AAAA,EACb,IAAM,EAAA;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"inputProperties.cjs.js","sources":["../../src/actions/inputProperties.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\nconst 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};\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:\n '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:\n 'Require branches to be up to date before merging. The default value is `true`',\n type: 'boolean',\n default: true,\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 default: false,\n description:\n '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 default: false,\n description:\n 'Delete the branch after merging the PR. The default value is `false`',\n};\nconst gitAuthorName = {\n title: 'Default Author Name',\n type: 'string',\n default: 'Scaffolder',\n description:\n '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 default: true,\n description: 'Allow merge commits. The default value is `true`',\n};\nconst allowSquashMerge = {\n title: 'Allow Squash Merges',\n type: 'boolean',\n default: true,\n description: 'Allow squash merges. The default value is `true`',\n};\nconst allowUpdateBranch = {\n title: 'Allow Update Branch',\n type: 'boolean',\n default: false,\n description: 'Allow branch to be updated. The default value is `false`',\n};\nconst squashMergeCommitTitle = {\n title: 'Default squash merge commit title',\n enum: ['PR_TITLE', 'COMMIT_OR_PR_TITLE'],\n type: 'string',\n default: 'COMMIT_OR_PR_TITLE',\n description:\n '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 type: 'string',\n default: 'COMMIT_MESSAGES',\n description:\n '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 default: true,\n description: 'Allow rebase merges. The default value is `true`',\n};\nconst allowAutoMerge = {\n title: 'Allow Auto Merges',\n type: 'boolean',\n default: false,\n description:\n '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:\n '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 default: true,\n description:\n 'Enable the wiki for the repository. The default value is `true`',\n};\nconst hasIssues = {\n title: 'Enable issues',\n type: 'boolean',\n default: true,\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 default: 'master',\n description:\n 'Sets the default branch on the repository. The default value is `master`',\n};\nconst protectDefaultBranch = {\n title: 'Protect Default Branch',\n type: 'boolean',\n default: true,\n description:\n '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 default: true,\n description:\n '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 default: 'initial commit',\n description:\n '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:\n '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 requiredLinearHistory = {\n title: 'Require linear history',\n type: 'boolean',\n description: `Prevent merge commits from being pushed to matching branches.`,\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\nconst subscribe = {\n title: 'Subscribe to repository',\n description: `Subscribe to the repository. The default value is 'false'`,\n type: 'boolean',\n};\n\nexport { access };\nexport { allowMergeCommit };\nexport { allowRebaseMerge };\nexport { allowSquashMerge };\nexport { squashMergeCommitTitle };\nexport { squashMergeCommitMessage };\nexport { allowAutoMerge };\nexport { allowUpdateBranch };\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 { requiredLinearHistory };\nexport { repoVariables };\nexport { secrets };\nexport { oidcCustomization };\nexport { customProperties };\nexport { subscribe };\n"],"names":[],"mappings":";;AAgBA,MAAM,OAAU,GAAA;AAAA,EACd,KAAO,EAAA,qBAAA;AAAA,EACP,WACE,EAAA,kJAAA;AAAA,EACF,IAAM,EAAA;AACR;AACA,MAAM,WAAc,GAAA;AAAA,EAClB,KAAO,EAAA,wBAAA;AAAA,EACP,IAAM,EAAA;AACR;AACA,MAAM,QAAW,GAAA;AAAA,EACf,KAAO,EAAA,qBAAA;AAAA,EACP,IAAM,EAAA;AACR;AACA,MAAM,MAAS,GAAA;AAAA,EACb,KAAO,EAAA,mBAAA;AAAA,EACP,WACE,EAAA,yJAAA;AAAA,EACF,IAAM,EAAA;AACR;AACA,MAAM,uBAA0B,GAAA;AAAA,EAC9B,KAAO,EAAA,4BAAA;AAAA,EACP,WACE,EAAA,+EAAA;AAAA,EACF,IAAM,EAAA;AACR;AACA,MAAM,mBAAsB,GAAA;AAAA,EAC1B,KAAO,EAAA,uBAAA;AAAA,EACP,WACE,EAAA,gGAAA;AAAA,EACF,IAAM,EAAA;AACR;AACA,MAAM,2BAA8B,GAAA;AAAA,EAClC,KAAO,EAAA,gCAAA;AAAA,EACP,WACE,EAAA,yEAAA;AAAA,EACF,IAAM,EAAA,OAAA;AAAA,EACN,KAAO,EAAA;AAAA,IACL,IAAM,EAAA;AAAA;AAEV;AACA,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AAAA,MACA,WAAa,EAAA,CAAA,iGAAA;AAAA;AACf;AAEJ;AAEA,MAAM,gBAAmB,GAAA;AAAA,EACvB,KAAO,EAAA,8BAAA;AAAA,EACP,WACE,EAAA,uGAAA;AAAA,EACF,IAAM,EAAA;AACR;AAEA,MAAM,SAAY,GAAA;AAAA,EAChB,KAAO,EAAA,yBAAA;AAAA,EACP,WAAa,EAAA,CAAA,yDAAA,CAAA;AAAA,EACb,IAAM,EAAA;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ declare function createGithubRepoCreateAction(options: {
|
|
|
62
62
|
squashMergeCommitMessage?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK";
|
|
63
63
|
allowMergeCommit?: boolean;
|
|
64
64
|
allowAutoMerge?: boolean;
|
|
65
|
+
allowUpdateBranch?: boolean;
|
|
65
66
|
requireCodeOwnerReviews?: boolean;
|
|
66
67
|
bypassPullRequestAllowances?: {
|
|
67
68
|
users?: string[];
|
|
@@ -311,6 +312,7 @@ declare function createPublishGithubAction(options: {
|
|
|
311
312
|
squashMergeCommitMessage?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK";
|
|
312
313
|
allowMergeCommit?: boolean;
|
|
313
314
|
allowAutoMerge?: boolean;
|
|
315
|
+
allowUpdateBranch?: boolean;
|
|
314
316
|
sourcePath?: string;
|
|
315
317
|
bypassPullRequestAllowances?: {
|
|
316
318
|
users?: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder-backend-module-github",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "The github module for @backstage/plugin-scaffolder-backend",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin-module",
|
|
@@ -30,6 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"main": "./dist/index.cjs.js",
|
|
32
32
|
"types": "./dist/index.d.ts",
|
|
33
|
+
"typesVersions": {
|
|
34
|
+
"*": {
|
|
35
|
+
"package.json": [
|
|
36
|
+
"package.json"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
33
40
|
"files": [
|
|
34
41
|
"dist"
|
|
35
42
|
],
|
|
@@ -43,14 +50,14 @@
|
|
|
43
50
|
"test": "backstage-cli package test"
|
|
44
51
|
},
|
|
45
52
|
"dependencies": {
|
|
46
|
-
"@backstage/backend-plugin-api": "1.
|
|
47
|
-
"@backstage/catalog-client": "1.9.1",
|
|
48
|
-
"@backstage/catalog-model": "1.7.3",
|
|
49
|
-
"@backstage/config": "1.3.2",
|
|
50
|
-
"@backstage/errors": "1.2.7",
|
|
51
|
-
"@backstage/integration": "1.16.3
|
|
52
|
-
"@backstage/plugin-scaffolder-node": "0.8.1
|
|
53
|
-
"@backstage/types": "1.2.1",
|
|
53
|
+
"@backstage/backend-plugin-api": "^1.3.0",
|
|
54
|
+
"@backstage/catalog-client": "^1.9.1",
|
|
55
|
+
"@backstage/catalog-model": "^1.7.3",
|
|
56
|
+
"@backstage/config": "^1.3.2",
|
|
57
|
+
"@backstage/errors": "^1.2.7",
|
|
58
|
+
"@backstage/integration": "^1.16.3",
|
|
59
|
+
"@backstage/plugin-scaffolder-node": "^0.8.1",
|
|
60
|
+
"@backstage/types": "^1.2.1",
|
|
54
61
|
"@octokit/webhooks": "^10.9.2",
|
|
55
62
|
"libsodium-wrappers": "^0.7.11",
|
|
56
63
|
"octokit": "^3.0.0",
|
|
@@ -58,9 +65,9 @@
|
|
|
58
65
|
"yaml": "^2.0.0"
|
|
59
66
|
},
|
|
60
67
|
"devDependencies": {
|
|
61
|
-
"@backstage/backend-test-utils": "1.
|
|
62
|
-
"@backstage/cli": "0.32.0
|
|
63
|
-
"@backstage/plugin-scaffolder-node-test-utils": "0.2.1
|
|
68
|
+
"@backstage/backend-test-utils": "^1.4.0",
|
|
69
|
+
"@backstage/cli": "^0.32.0",
|
|
70
|
+
"@backstage/plugin-scaffolder-node-test-utils": "^0.2.1",
|
|
64
71
|
"@types/libsodium-wrappers": "^0.7.10",
|
|
65
72
|
"fs-extra": "^11.2.0",
|
|
66
73
|
"jsonschema": "^1.2.6"
|