@backstage/plugin-scaffolder-backend-module-github 0.8.3-next.1 → 0.9.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 CHANGED
@@ -1,5 +1,66 @@
1
1
  # @backstage/plugin-scaffolder-backend-module-github
2
2
 
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f0f06b4: Adding a new scaffolder action `github:issues:create` following the reference of `github:issues:label` with `dryRun` testing possibility
8
+
9
+ It can be used like this
10
+
11
+ ```
12
+ steps:
13
+ - id: create-simple-issue
14
+ name: Create Simple Issue
15
+ action: github:issues:create
16
+ input:
17
+ repoUrl: ${{ parameters.repoUrl }}
18
+ title: "[${{ parameters.projectName }}] Simple Bug Report"
19
+ body: |
20
+ ## Bug Description
21
+ This is a simple bug report created by the scaffolder template.
22
+
23
+ ### Steps to Reproduce
24
+ 1. Run the application
25
+ 2. Navigate to the main page
26
+ 3. Click on the problematic button
27
+
28
+ ### Expected Behavior
29
+ The button should work correctly.
30
+
31
+ ### Actual Behavior
32
+ The button does not respond to clicks.
33
+ output:
34
+ links:
35
+ - title: Simple Issue
36
+ url: ${{ steps['create-simple-issue'].output.issueUrl }}
37
+ ```
38
+
39
+ ### Patch Changes
40
+
41
+ - aee107b: Add `auto_init` option to `github:repo:create` action to create repository with an initial commit containing a README.md file
42
+
43
+ This initial commit is created by GitHub itself and the commit is signed, so the repository will not be empty after creation.
44
+
45
+ ```diff
46
+ - action: github:repo:create
47
+ id: init-new-repo
48
+ input:
49
+ repoUrl: 'github.com?repo=repo&owner=owner'
50
+ description: This is the description
51
+ visibility: private
52
+ + autoInit: true
53
+
54
+ ```
55
+
56
+ - 6393b78: Add block creations field in github branch protection scaffolder actions
57
+ - Updated dependencies
58
+ - @backstage/plugin-catalog-node@1.19.0
59
+ - @backstage/integration@1.18.0
60
+ - @backstage/types@1.2.2
61
+ - @backstage/backend-plugin-api@1.4.3
62
+ - @backstage/plugin-scaffolder-node@0.11.1
63
+
3
64
  ## 0.8.3-next.1
4
65
 
5
66
  ### Patch Changes
@@ -19,7 +19,8 @@ const enableBranchProtectionOnDefaultRepoBranch = async ({
19
19
  enforceAdmins = true,
20
20
  dismissStaleReviews = false,
21
21
  requiredCommitSigning = false,
22
- requiredLinearHistory = false
22
+ requiredLinearHistory = false,
23
+ blockCreations = false
23
24
  }) => {
24
25
  const tryOnce = async () => {
25
26
  try {
@@ -51,7 +52,8 @@ const enableBranchProtectionOnDefaultRepoBranch = async ({
51
52
  require_last_push_approval: requireLastPushApproval
52
53
  },
53
54
  required_conversation_resolution: requiredConversationResolution,
54
- required_linear_history: requiredLinearHistory
55
+ required_linear_history: requiredLinearHistory,
56
+ block_creations: blockCreations
55
57
  });
56
58
  if (requiredCommitSigning) {
57
59
  await client.rest.repos.createCommitSignatureProtection({
@@ -1 +1 @@
1
- {"version":3,"file":"gitHelpers.cjs.js","sources":["../../src/actions/gitHelpers.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { assertError } from '@backstage/errors';\nimport { Octokit } from 'octokit';\nimport { LoggerService } from '@backstage/backend-plugin-api';\n\ntype BranchProtectionOptions = {\n client: Octokit;\n owner: string;\n repoName: string;\n logger: LoggerService;\n requireCodeOwnerReviews: boolean;\n requiredStatusCheckContexts?: string[];\n bypassPullRequestAllowances?: {\n users?: string[];\n teams?: string[];\n apps?: string[];\n };\n requiredApprovingReviewCount?: number;\n restrictions?: {\n users: string[];\n teams: string[];\n apps?: string[];\n };\n requireBranchesToBeUpToDate?: boolean;\n requiredConversationResolution?: boolean;\n requireLastPushApproval: boolean;\n defaultBranch?: string;\n enforceAdmins?: boolean;\n dismissStaleReviews?: boolean;\n requiredCommitSigning?: boolean;\n requiredLinearHistory?: boolean;\n};\n\nexport const enableBranchProtectionOnDefaultRepoBranch = async ({\n repoName,\n client,\n owner,\n logger,\n requireCodeOwnerReviews,\n bypassPullRequestAllowances,\n requiredApprovingReviewCount,\n restrictions,\n requiredStatusCheckContexts = [],\n requireBranchesToBeUpToDate = true,\n requiredConversationResolution = false,\n requireLastPushApproval = false,\n defaultBranch = 'master',\n enforceAdmins = true,\n dismissStaleReviews = false,\n requiredCommitSigning = false,\n requiredLinearHistory = false,\n}: BranchProtectionOptions): Promise<void> => {\n const tryOnce = async () => {\n try {\n await client.rest.repos.updateBranchProtection({\n mediaType: {\n /**\n * 👇 we need this preview because allowing a custom\n * reviewer count on branch protection is a preview\n * feature\n *\n * More here: https://docs.github.com/en/rest/overview/api-previews#require-multiple-approving-reviews\n */\n previews: ['luke-cage-preview'],\n },\n owner,\n repo: repoName,\n branch: defaultBranch,\n required_status_checks: {\n strict: requireBranchesToBeUpToDate,\n contexts: requiredStatusCheckContexts,\n },\n restrictions: restrictions ?? null,\n enforce_admins: enforceAdmins,\n required_pull_request_reviews: {\n required_approving_review_count: requiredApprovingReviewCount,\n require_code_owner_reviews: requireCodeOwnerReviews,\n bypass_pull_request_allowances: bypassPullRequestAllowances,\n dismiss_stale_reviews: dismissStaleReviews,\n require_last_push_approval: requireLastPushApproval,\n },\n required_conversation_resolution: requiredConversationResolution,\n required_linear_history: requiredLinearHistory,\n });\n\n if (requiredCommitSigning) {\n await client.rest.repos.createCommitSignatureProtection({\n owner,\n repo: repoName,\n branch: defaultBranch,\n });\n }\n } catch (e) {\n assertError(e);\n if (\n e.message.includes(\n 'Upgrade to GitHub Pro or make this repository public to enable this feature',\n )\n ) {\n logger.warn(\n 'Branch protection was not enabled as it requires GitHub Pro for private repositories',\n );\n } else {\n throw e;\n }\n }\n };\n\n try {\n await tryOnce();\n } catch (e) {\n if (!e.message.includes('Branch not found')) {\n throw e;\n }\n\n // GitHub has eventual consistency. Fail silently, wait, and try again.\n await new Promise(resolve => setTimeout(resolve, 600));\n await tryOnce();\n }\n};\n\nexport function entityRefToName(name: string): string {\n return name.replace(/^.*[:/]/g, '');\n}\n"],"names":["assertError"],"mappings":";;;;AAgDO,MAAM,4CAA4C,OAAO;AAAA,EAC9D,QAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,uBAAA;AAAA,EACA,2BAAA;AAAA,EACA,4BAAA;AAAA,EACA,YAAA;AAAA,EACA,8BAA8B,EAAC;AAAA,EAC/B,2BAAA,GAA8B,IAAA;AAAA,EAC9B,8BAAA,GAAiC,KAAA;AAAA,EACjC,uBAAA,GAA0B,KAAA;AAAA,EAC1B,aAAA,GAAgB,QAAA;AAAA,EAChB,aAAA,GAAgB,IAAA;AAAA,EAChB,mBAAA,GAAsB,KAAA;AAAA,EACtB,qBAAA,GAAwB,KAAA;AAAA,EACxB,qBAAA,GAAwB;AAC1B,CAAA,KAA8C;AAC5C,EAAA,MAAM,UAAU,YAAY;AAC1B,IAAA,IAAI;AACF,MAAA,MAAM,MAAA,CAAO,IAAA,CAAK,KAAA,CAAM,sBAAA,CAAuB;AAAA,QAC7C,SAAA,EAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAQT,QAAA,EAAU,CAAC,mBAAmB;AAAA,SAChC;AAAA,QACA,KAAA;AAAA,QACA,IAAA,EAAM,QAAA;AAAA,QACN,MAAA,EAAQ,aAAA;AAAA,QACR,sBAAA,EAAwB;AAAA,UACtB,MAAA,EAAQ,2BAAA;AAAA,UACR,QAAA,EAAU;AAAA,SACZ;AAAA,QACA,cAAc,YAAA,IAAgB,IAAA;AAAA,QAC9B,cAAA,EAAgB,aAAA;AAAA,QAChB,6BAAA,EAA+B;AAAA,UAC7B,+BAAA,EAAiC,4B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 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { assertError } from '@backstage/errors';\nimport { Octokit } from 'octokit';\nimport { LoggerService } from '@backstage/backend-plugin-api';\n\ntype BranchProtectionOptions = {\n client: Octokit;\n owner: string;\n repoName: string;\n logger: LoggerService;\n requireCodeOwnerReviews: boolean;\n requiredStatusCheckContexts?: string[];\n bypassPullRequestAllowances?: {\n users?: string[];\n teams?: string[];\n apps?: string[];\n };\n requiredApprovingReviewCount?: number;\n restrictions?: {\n users: string[];\n teams: string[];\n apps?: string[];\n };\n requireBranchesToBeUpToDate?: boolean;\n requiredConversationResolution?: boolean;\n requireLastPushApproval: boolean;\n defaultBranch?: string;\n enforceAdmins?: boolean;\n dismissStaleReviews?: boolean;\n requiredCommitSigning?: boolean;\n requiredLinearHistory?: boolean;\n blockCreations?: boolean;\n};\n\nexport const enableBranchProtectionOnDefaultRepoBranch = async ({\n repoName,\n client,\n owner,\n logger,\n requireCodeOwnerReviews,\n bypassPullRequestAllowances,\n requiredApprovingReviewCount,\n restrictions,\n requiredStatusCheckContexts = [],\n requireBranchesToBeUpToDate = true,\n requiredConversationResolution = false,\n requireLastPushApproval = false,\n defaultBranch = 'master',\n enforceAdmins = true,\n dismissStaleReviews = false,\n requiredCommitSigning = false,\n requiredLinearHistory = false,\n blockCreations = false,\n}: BranchProtectionOptions): Promise<void> => {\n const tryOnce = async () => {\n try {\n await client.rest.repos.updateBranchProtection({\n mediaType: {\n /**\n * 👇 we need this preview because allowing a custom\n * reviewer count on branch protection is a preview\n * feature\n *\n * More here: https://docs.github.com/en/rest/overview/api-previews#require-multiple-approving-reviews\n */\n previews: ['luke-cage-preview'],\n },\n owner,\n repo: repoName,\n branch: defaultBranch,\n required_status_checks: {\n strict: requireBranchesToBeUpToDate,\n contexts: requiredStatusCheckContexts,\n },\n restrictions: restrictions ?? null,\n enforce_admins: enforceAdmins,\n required_pull_request_reviews: {\n required_approving_review_count: requiredApprovingReviewCount,\n require_code_owner_reviews: requireCodeOwnerReviews,\n bypass_pull_request_allowances: bypassPullRequestAllowances,\n dismiss_stale_reviews: dismissStaleReviews,\n require_last_push_approval: requireLastPushApproval,\n },\n required_conversation_resolution: requiredConversationResolution,\n required_linear_history: requiredLinearHistory,\n block_creations: blockCreations,\n });\n\n if (requiredCommitSigning) {\n await client.rest.repos.createCommitSignatureProtection({\n owner,\n repo: repoName,\n branch: defaultBranch,\n });\n }\n } catch (e) {\n assertError(e);\n if (\n e.message.includes(\n 'Upgrade to GitHub Pro or make this repository public to enable this feature',\n )\n ) {\n logger.warn(\n 'Branch protection was not enabled as it requires GitHub Pro for private repositories',\n );\n } else {\n throw e;\n }\n }\n };\n\n try {\n await tryOnce();\n } catch (e) {\n if (!e.message.includes('Branch not found')) {\n throw e;\n }\n\n // GitHub has eventual consistency. Fail silently, wait, and try again.\n await new Promise(resolve => setTimeout(resolve, 600));\n await tryOnce();\n }\n};\n\nexport function entityRefToName(name: string): string {\n return name.replace(/^.*[:/]/g, '');\n}\n"],"names":["assertError"],"mappings":";;;;AAiDO,MAAM,4CAA4C,OAAO;AAAA,EAC9D,QAAA;AAAA,EACA,MAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,uBAAA;AAAA,EACA,2BAAA;AAAA,EACA,4BAAA;AAAA,EACA,YAAA;AAAA,EACA,8BAA8B,EAAC;AAAA,EAC/B,2BAAA,GAA8B,IAAA;AAAA,EAC9B,8BAAA,GAAiC,KAAA;AAAA,EACjC,uBAAA,GAA0B,KAAA;AAAA,EAC1B,aAAA,GAAgB,QAAA;AAAA,EAChB,aAAA,GAAgB,IAAA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A;AAAA,QACR;AAAA,OACF,EACA;AACA,QAAA,MAAA,CAAO,IAAA;AAAA,UACL;AAAA,SACF;AAAA,MACF,CAAA,MAAO;AACL,QAAA,MAAM,CAAA;AAAA,MACR;AAAA,IACF;AAAA,EACF,CAAA;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,OAAA,EAAQ;AAAA,EAChB,SAAS,CAAA,EAAG;AACV,IAAA,IAAI,CAAC,CAAA,CAAE,OAAA,CAAQ,QAAA,CAAS,kBAAkB,CAAA,EAAG;AAC3C,MAAA,MAAM,CAAA;AAAA,IACR;AAGA,IAAA,MAAM,IAAI,OAAA,CAAQ,CAAA,OAAA,KAAW,UAAA,CAAW,OAAA,EAAS,GAAG,CAAC,CAAA;AACrD,IAAA,MAAM,OAAA,EAAQ;AAAA,EAChB;AACF;AAEO,SAAS,gBAAgB,IAAA,EAAsB;AACpD,EAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,UAAA,EAAY,EAAE,CAAA;AACpC;;;;;"}
@@ -30,6 +30,7 @@ function createGithubBranchProtectionAction(options) {
30
30
  requireLastPushApproval: inputProperties.requireLastPushApproval,
31
31
  requiredCommitSigning: inputProperties.requiredCommitSigning,
32
32
  requiredLinearHistory: inputProperties.requiredLinearHistory,
33
+ blockCreations: inputProperties.blockCreations,
33
34
  token: inputProperties.token
34
35
  }
35
36
  },
@@ -49,6 +50,7 @@ function createGithubBranchProtectionAction(options) {
49
50
  requireLastPushApproval = false,
50
51
  requiredCommitSigning = false,
51
52
  requiredLinearHistory = false,
53
+ blockCreations,
52
54
  token: providedToken
53
55
  } = ctx.input;
54
56
  const { host, owner, repo } = pluginScaffolderNode.parseRepoUrl(repoUrl, integrations);
@@ -96,7 +98,8 @@ function createGithubBranchProtectionAction(options) {
96
98
  enforceAdmins,
97
99
  dismissStaleReviews,
98
100
  requiredCommitSigning,
99
- requiredLinearHistory
101
+ requiredLinearHistory,
102
+ blockCreations
100
103
  });
101
104
  }
102
105
  });
@@ -1 +1 @@
1
- {"version":3,"file":"githubBranchProtection.cjs.js","sources":["../../src/actions/githubBranchProtection.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { examples } from './githubBranchProtection.examples';\nimport * as inputProps from './inputProperties';\nimport { getOctokitOptions } from '../util';\nimport { Octokit } from 'octokit';\nimport { enableBranchProtectionOnDefaultRepoBranch } from './gitHelpers';\n\n/**\n * Creates an `github:branch-protection:create` Scaffolder action that configured Branch Protection in a Github Repository.\n *\n * @public\n */\nexport function createGithubBranchProtectionAction(options: {\n integrations: ScmIntegrationRegistry;\n}) {\n const { integrations } = options;\n\n return createTemplateAction({\n id: 'github:branch-protection:create',\n description: 'Configures Branch Protection',\n examples,\n schema: {\n input: {\n repoUrl: inputProps.repoUrl,\n branch: inputProps.branch,\n enforceAdmins: inputProps.protectEnforceAdmins,\n requiredApprovingReviewCount: inputProps.requiredApprovingReviewCount,\n requireCodeOwnerReviews: inputProps.requireCodeOwnerReviews,\n dismissStaleReviews: inputProps.dismissStaleReviews,\n bypassPullRequestAllowances: inputProps.bypassPullRequestAllowances,\n restrictions: inputProps.restrictions,\n requiredStatusCheckContexts: inputProps.requiredStatusCheckContexts,\n requireBranchesToBeUpToDate: inputProps.requireBranchesToBeUpToDate,\n requiredConversationResolution:\n inputProps.requiredConversationResolution,\n requireLastPushApproval: inputProps.requireLastPushApproval,\n requiredCommitSigning: inputProps.requiredCommitSigning,\n requiredLinearHistory: inputProps.requiredLinearHistory,\n token: inputProps.token,\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n branch,\n enforceAdmins = true,\n requiredApprovingReviewCount = 1,\n requireCodeOwnerReviews = false,\n dismissStaleReviews = false,\n bypassPullRequestAllowances,\n restrictions,\n requiredStatusCheckContexts = [],\n requireBranchesToBeUpToDate = true,\n requiredConversationResolution = false,\n requireLastPushApproval = false,\n requiredCommitSigning = false,\n requiredLinearHistory = false,\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 const client = new Octokit({\n ...octokitOptions,\n log: ctx.logger,\n });\n\n const defaultBranch = await ctx.checkpoint({\n key: `read.default.branch.${owner}.${repo}`,\n fn: async () => {\n const repository = await client.rest.repos.get({\n owner: owner,\n repo: repo,\n });\n return repository.data.default_branch;\n },\n });\n\n await ctx.checkpoint({\n key: `enable.branch.protection.${owner}.${repo}`,\n fn: async () => {\n await enableBranchProtectionOnDefaultRepoBranch({\n repoName: repo,\n client,\n owner,\n logger: ctx.logger,\n requireCodeOwnerReviews,\n bypassPullRequestAllowances,\n requiredApprovingReviewCount,\n restrictions,\n requiredStatusCheckContexts,\n requireBranchesToBeUpToDate,\n requiredConversationResolution,\n requireLastPushApproval,\n defaultBranch: branch ?? defaultBranch,\n enforceAdmins,\n dismissStaleReviews,\n requiredCommitSigning,\n requiredLinearHistory,\n });\n },\n });\n },\n });\n}\n"],"names":["createTemplateAction","examples","inputProps.repoUrl","inputProps.branch","inputProps.protectEnforceAdmins","inputProps.requiredApprovingReviewCount","inputProps.requireCodeOwnerReviews","inputProps.dismissStaleReviews","inputProps.bypassPullRequestAllowances","inputProps.restrictions","inputProps.requiredStatusCheckContexts","inputProps.requireBranchesToBeUpToDate","inputProps.requiredConversationResolution","inputProps.requireLastPushApproval","inputProps.requiredCommitSigning","inputProps.requiredLinearHistory","inputProps.token","parseRepoUrl","InputError","getOctokitOptions","Octokit","enableBranchProtectionOnDefaultRepoBranch"],"mappings":";;;;;;;;;;AAiCO,SAAS,mCAAmC,OAAA,EAEhD;AACD,EAAA,MAAM,EAAE,cAAa,GAAI,OAAA;AAEzB,EAAA,OAAOA,yCAAA,CAAqB;AAAA,IAC1B,EAAA,EAAI,iCAAA;AAAA,IACJ,WAAA,EAAa,8BAAA;AAAA,cACbC,wCAAA;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO;AAAA,QACL,SAASC,uBAAW;AAAA,QACpB,QAAQC,sBAAW;AAAA,QACnB,eAAeC,oCAAW;AAAA,QAC1B,8BAA8BC,4CAAW;AAAA,QACzC,yBAAyBC,uCAAW;AAAA,QACpC,qBAAqBC,mCAAW;AAAA,QAChC,6BAA6BC,2CAAW;AAAA,QACxC,cAAcC,4BAAW;AAAA,QACzB,6BAA6BC,2CAAW;AAAA,QACxC,6BAA6BC,2CAAW;AAAA,QACxC,gCACEC,8CAAW;AAAA,QACb,yBAAyBC,uCAAW;AAAA,QACpC,uBAAuBC,qCAAW;AAAA,QAClC,uBAAuBC,qCAAW;AAAA,QAClC,OAAOC;AAAW;AACpB,KACF;AAAA,IACA,MAAM,QAAQ,GAAA,EAAK;AACjB,MAAA,MAAM;AAAA,QACJ,OAAA;AAAA,QACA,MAAA;AAAA,QACA,aAAA,GAAgB,IAAA;AAAA,QAChB,4BAAA,GAA+B,CAAA;AAAA,QAC/B,uBAAA,GAA0B,KAAA;AAAA,QAC1B,mBAAA,GAAsB,KAAA;AAAA,QACtB,2BAAA;AAAA,QACA,YAAA;AAAA,QACA,8BAA8B,EAAC;AAAA,QAC/B,2BAAA,GAA8B,IAAA;AAAA,QAC9B,8BAAA,GAAiC,KAAA;AAAA,QACjC,uBAAA,GAA0B,KAAA;AAAA,QAC1B,qBAAA,GAAwB,K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I,MAAA;AAAA,YACZ,uBAAA;AAAA,YACA,2BAAA;AAAA,YACA,4BAAA;AAAA,YACA,YAAA;AAAA,YACA,2BAAA;AAAA,YACA,2BAAA;AAAA,YACA,8BAAA;AAAA,YACA,uBAAA;AAAA,YACA,eAAe,MAAA,IAAU,aAAA;AAAA,YACzB,aAAA;AAAA,YACA,mBAAA;AAAA,YACA,qBAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,QACH;AAAA,OACD,CAAA;AAAA,IACH;AAAA,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"githubBranchProtection.cjs.js","sources":["../../src/actions/githubBranchProtection.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { examples } from './githubBranchProtection.examples';\nimport * as inputProps from './inputProperties';\nimport { getOctokitOptions } from '../util';\nimport { Octokit } from 'octokit';\nimport { enableBranchProtectionOnDefaultRepoBranch } from './gitHelpers';\n\n/**\n * Creates an `github:branch-protection:create` Scaffolder action that configured Branch Protection in a Github Repository.\n *\n * @public\n */\nexport function createGithubBranchProtectionAction(options: {\n integrations: ScmIntegrationRegistry;\n}) {\n const { integrations } = options;\n\n return createTemplateAction({\n id: 'github:branch-protection:create',\n description: 'Configures Branch Protection',\n examples,\n schema: {\n input: {\n repoUrl: inputProps.repoUrl,\n branch: inputProps.branch,\n enforceAdmins: inputProps.protectEnforceAdmins,\n requiredApprovingReviewCount: inputProps.requiredApprovingReviewCount,\n requireCodeOwnerReviews: inputProps.requireCodeOwnerReviews,\n dismissStaleReviews: inputProps.dismissStaleReviews,\n bypassPullRequestAllowances: inputProps.bypassPullRequestAllowances,\n restrictions: inputProps.restrictions,\n requiredStatusCheckContexts: inputProps.requiredStatusCheckContexts,\n requireBranchesToBeUpToDate: inputProps.requireBranchesToBeUpToDate,\n requiredConversationResolution:\n inputProps.requiredConversationResolution,\n requireLastPushApproval: inputProps.requireLastPushApproval,\n requiredCommitSigning: inputProps.requiredCommitSigning,\n requiredLinearHistory: inputProps.requiredLinearHistory,\n blockCreations: inputProps.blockCreations,\n token: inputProps.token,\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n branch,\n enforceAdmins = true,\n requiredApprovingReviewCount = 1,\n requireCodeOwnerReviews = false,\n dismissStaleReviews = false,\n bypassPullRequestAllowances,\n restrictions,\n requiredStatusCheckContexts = [],\n requireBranchesToBeUpToDate = true,\n requiredConversationResolution = false,\n requireLastPushApproval = false,\n requiredCommitSigning = false,\n requiredLinearHistory = false,\n blockCreations,\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 const client = new Octokit({\n ...octokitOptions,\n log: ctx.logger,\n });\n\n const defaultBranch = await ctx.checkpoint({\n key: `read.default.branch.${owner}.${repo}`,\n fn: async () => {\n const repository = await client.rest.repos.get({\n owner: owner,\n repo: repo,\n });\n return repository.data.default_branch;\n },\n });\n\n await ctx.checkpoint({\n key: `enable.branch.protection.${owner}.${repo}`,\n fn: async () => {\n await enableBranchProtectionOnDefaultRepoBranch({\n repoName: repo,\n client,\n owner,\n logger: ctx.logger,\n requireCodeOwnerReviews,\n bypassPullRequestAllowances,\n requiredApprovingReviewCount,\n restrictions,\n requiredStatusCheckContexts,\n requireBranchesToBeUpToDate,\n requiredConversationResolution,\n requireLastPushApproval,\n defaultBranch: branch ?? defaultBranch,\n enforceAdmins,\n dismissStaleReviews,\n requiredCommitSigning,\n requiredLinearHistory,\n blockCreations,\n });\n },\n });\n },\n });\n}\n"],"names":["createTemplateAction","examples","inputProps.repoUrl","inputProps.branch","inputProps.protectEnforceAdmins","inputProps.requiredApprovingReviewCount","inputProps.requireCodeOwnerReviews","inputProps.dismissStaleReviews","inputProps.bypassPullRequestAllowances","inputProps.restrictions","inputProps.requiredStatusCheckContexts","inputProps.requireBranchesToBeUpToDate","inputProps.requiredConversationResolution","inputProps.requireLastPushApproval","inputProps.requiredCommitSigning","inputProps.requiredLinearHistory","inputProps.blockCreations","inputProps.token","parseRepoUrl","InputError","getOctokitOptions","Octokit","enableBranchProtectionOnDefaultRepoBranch"],"mappings":";;;;;;;;;;AAiCO,SAAS,mCAAmC,OAAA,EAEhD;AACD,EAAA,MAAM,EAAE,cAAa,GAAI,OAAA;AAEzB,EAAA,OAAOA,yCAAA,CAAqB;AAAA,IAC1B,EAAA,EAAI,iCAAA;AAAA,IACJ,WAAA,EAAa,8BAAA;AAAA,cACbC,wCAAA;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO;AAAA,QACL,SAASC,uBAAW;AAAA,QACpB,QAAQC,sBAAW;AAAA,QACnB,eAAeC,oCAAW;AAAA,QAC1B,8BAA8BC,4CAAW;AAAA,QACzC,yBAAyBC,uCAAW;AAAA,QACpC,qBAAqBC,mCAAW;AAAA,QAChC,6BAA6BC,2CAAW;AAAA,QACxC,cAAcC,4BAAW;AAAA,QACzB,6BAA6BC,2CAAW;AAAA,QACxC,6BAA6BC,2CAAW;AAAA,QACxC,gCACEC,8CAAW;AAAA,QACb,yBAAyBC,uCAAW;AAAA,QACpC,uBAAuBC,qCAAW;AAAA,QAClC,uBAAuBC,qCAAW;AAAA,QAClC,gBAAgBC,8BAAW;AAAA,QAC3B,OAAOC;A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AAa,MAAM,MAAA,CAAO,IAAA,CAAK,MAAM,GAAA,CAAI;AAAA,YAC7C,KAAA;AAAA,YACA;AAAA,WACD,CAAA;AACD,UAAA,OAAO,WAAW,IAAA,CAAK,cAAA;AAAA,QACzB;AAAA,OACD,CAAA;AAED,MAAA,MAAM,IAAI,UAAA,CAAW;AAAA,QACnB,GAAA,EAAK,CAAA,yBAAA,EAA4B,KAAK,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA;AAAA,QAC9C,IAAI,YAAY;AACd,UAAA,MAAMC,oDAAA,CAA0C;AAAA,YAC9C,QAAA,EAAU,IAAA;AAAA,YACV,MAAA;AAAA,YACA,KAAA;AAAA,YACA,QAAQ,GAAA,CAAI,MAAA;AAAA,YACZ,uBAAA;AAAA,YACA,2BAAA;AAAA,YACA,4BAAA;AAAA,YACA,YAAA;AAAA,YACA,2BAAA;AAAA,YACA,2BAAA;AAAA,YACA,8BAAA;AAAA,YACA,uBAAA;AAAA,YACA,eAAe,MAAA,IAAU,aAAA;AAAA,YACzB,aAAA;AAAA,YACA,mBAAA;AAAA,YACA,qBAAA;AAAA,YACA,qBAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,QACH;AAAA,OACD,CAAA;AAAA,IACH;AAAA,GACD,CAAA;AACH;;;;"}
@@ -0,0 +1,122 @@
1
+ 'use strict';
2
+
3
+ var pluginScaffolderNode = require('@backstage/plugin-scaffolder-node');
4
+ var errors = require('@backstage/errors');
5
+ var octokit = require('octokit');
6
+ var util = require('../util.cjs.js');
7
+ var githubIssuesCreate_examples = require('./githubIssuesCreate.examples.cjs.js');
8
+
9
+ function createGithubIssuesCreateAction(options) {
10
+ const { integrations, githubCredentialsProvider } = options;
11
+ return pluginScaffolderNode.createTemplateAction({
12
+ id: "github:issues:create",
13
+ description: "Creates an issue on GitHub.",
14
+ examples: githubIssuesCreate_examples.examples,
15
+ supportsDryRun: true,
16
+ schema: {
17
+ input: {
18
+ repoUrl: (z) => z.string({
19
+ description: "Accepts the format `github.com?repo=reponame&owner=owner` where `reponame` is the repository name and `owner` is an organization or username"
20
+ }),
21
+ title: (z) => z.string({
22
+ description: "The title of the issue"
23
+ }),
24
+ body: (z) => z.string({
25
+ description: "The contents of the issue"
26
+ }).optional(),
27
+ assignees: (z) => z.array(z.string(), {
28
+ description: "Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise."
29
+ }).optional(),
30
+ milestone: (z) => z.union([z.string(), z.number()], {
31
+ description: "The number of the milestone to associate this issue with. NOTE: Only users with push access can set the milestone for new issues. The milestone is silently dropped otherwise."
32
+ }).optional(),
33
+ labels: (z) => z.array(z.string(), {
34
+ description: "Labels to associate with this issue. NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise."
35
+ }).optional(),
36
+ token: (z) => z.string({
37
+ description: "The `GITHUB_TOKEN` to use for authorization to GitHub"
38
+ }).optional()
39
+ },
40
+ output: {
41
+ issueUrl: (z) => z.string({
42
+ description: "The URL of the created issue"
43
+ }),
44
+ issueNumber: (z) => z.number({
45
+ description: "The number of the created issue"
46
+ })
47
+ }
48
+ },
49
+ async handler(ctx) {
50
+ const {
51
+ repoUrl,
52
+ title,
53
+ body,
54
+ assignees,
55
+ milestone,
56
+ labels,
57
+ token: providedToken
58
+ } = ctx.input;
59
+ const { host, owner, repo } = pluginScaffolderNode.parseRepoUrl(repoUrl, integrations);
60
+ ctx.logger.info(`Creating issue "${title}" on repo ${repo}`);
61
+ if (!owner) {
62
+ throw new errors.InputError("Invalid repository owner provided in repoUrl");
63
+ }
64
+ const octokitOptions = await util.getOctokitOptions({
65
+ integrations,
66
+ credentialsProvider: githubCredentialsProvider,
67
+ host,
68
+ owner,
69
+ repo,
70
+ token: providedToken
71
+ });
72
+ const client = new octokit.Octokit({
73
+ ...octokitOptions,
74
+ log: ctx.logger
75
+ });
76
+ if (ctx.isDryRun) {
77
+ ctx.logger.info(`Performing dry run of creating issue "${title}"`);
78
+ ctx.output("issueUrl", `https://github.com/${owner}/${repo}/issues/42`);
79
+ ctx.output("issueNumber", 42);
80
+ ctx.logger.info(`Dry run complete`);
81
+ return;
82
+ }
83
+ try {
84
+ const issue = await ctx.checkpoint({
85
+ key: `github.issues.create.${owner}.${repo}.${title}`,
86
+ fn: async () => {
87
+ const response = await client.rest.issues.create({
88
+ owner,
89
+ repo,
90
+ title,
91
+ body,
92
+ assignees,
93
+ milestone,
94
+ labels
95
+ });
96
+ return {
97
+ html_url: response.data.html_url,
98
+ number: response.data.number
99
+ };
100
+ }
101
+ });
102
+ if (!issue) {
103
+ throw new Error("Failed to create issue");
104
+ }
105
+ ctx.output("issueUrl", issue.html_url);
106
+ ctx.output("issueNumber", issue.number);
107
+ ctx.logger.info(
108
+ `Successfully created issue #${issue.number}: ${issue.html_url}`
109
+ );
110
+ } catch (e) {
111
+ errors.assertError(e);
112
+ ctx.logger.warn(
113
+ `Failed: creating issue '${title}' on repo: '${repo}', ${e.message}`
114
+ );
115
+ throw e;
116
+ }
117
+ }
118
+ });
119
+ }
120
+
121
+ exports.createGithubIssuesCreateAction = createGithubIssuesCreateAction;
122
+ //# sourceMappingURL=githubIssuesCreate.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubIssuesCreate.cjs.js","sources":["../../src/actions/githubIssuesCreate.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 {\n GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport {\n createTemplateAction,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { assertError, InputError } from '@backstage/errors';\nimport { Octokit } from 'octokit';\nimport { getOctokitOptions } from '../util';\nimport { examples } from './githubIssuesCreate.examples';\n\n/**\n * Creates an issue on GitHub\n * @public\n */\nexport function createGithubIssuesCreateAction(options: {\n integrations: ScmIntegrationRegistry;\n githubCredentialsProvider?: GithubCredentialsProvider;\n}) {\n const { integrations, githubCredentialsProvider } = options;\n\n return createTemplateAction({\n id: 'github:issues:create',\n description: 'Creates an issue on GitHub.',\n examples,\n supportsDryRun: true,\n schema: {\n input: {\n repoUrl: z =>\n z.string({\n description:\n 'Accepts the format `github.com?repo=reponame&owner=owner` where `reponame` is the repository name and `owner` is an organization or username',\n }),\n title: z =>\n z.string({\n description: 'The title of the issue',\n }),\n body: z =>\n z\n .string({\n description: 'The contents of the issue',\n })\n .optional(),\n assignees: z =>\n z\n .array(z.string(), {\n description:\n 'Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise.',\n })\n .optional(),\n milestone: z =>\n z\n .union([z.string(), z.number()], {\n description:\n 'The number of the milestone to associate this issue with. NOTE: Only users with push access can set the milestone for new issues. The milestone is silently dropped otherwise.',\n })\n .optional(),\n labels: z =>\n z\n .array(z.string(), {\n description:\n 'Labels to associate with this issue. NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise.',\n })\n .optional(),\n token: z =>\n z\n .string({\n description:\n 'The `GITHUB_TOKEN` to use for authorization to GitHub',\n })\n .optional(),\n },\n output: {\n issueUrl: z =>\n z.string({\n description: 'The URL of the created issue',\n }),\n issueNumber: z =>\n z.number({\n description: 'The number of the created issue',\n }),\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n title,\n body,\n assignees,\n milestone,\n labels,\n token: providedToken,\n } = ctx.input;\n\n const { host, owner, repo } = parseRepoUrl(repoUrl, integrations);\n ctx.logger.info(`Creating issue \"${title}\" on repo ${repo}`);\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 host,\n owner,\n repo,\n token: providedToken,\n });\n\n const client = new Octokit({\n ...octokitOptions,\n log: ctx.logger,\n });\n\n if (ctx.isDryRun) {\n ctx.logger.info(`Performing dry run of creating issue \"${title}\"`);\n ctx.output('issueUrl', `https://github.com/${owner}/${repo}/issues/42`);\n ctx.output('issueNumber', 42);\n ctx.logger.info(`Dry run complete`);\n return;\n }\n\n try {\n const issue = await ctx.checkpoint({\n key: `github.issues.create.${owner}.${repo}.${title}`,\n fn: async () => {\n const response = await client.rest.issues.create({\n owner,\n repo,\n title,\n body,\n assignees,\n milestone,\n labels,\n });\n\n return {\n html_url: response.data.html_url,\n number: response.data.number,\n };\n },\n });\n\n if (!issue) {\n throw new Error('Failed to create issue');\n }\n\n ctx.output('issueUrl', issue.html_url);\n ctx.output('issueNumber', issue.number);\n\n ctx.logger.info(\n `Successfully created issue #${issue.number}: ${issue.html_url}`,\n );\n } catch (e) {\n assertError(e);\n ctx.logger.warn(\n `Failed: creating issue '${title}' on repo: '${repo}', ${e.message}`,\n );\n throw e;\n }\n },\n });\n}\n"],"names":["createTemplateAction","examples","parseRepoUrl","InputError","getOctokitOptions","Octokit","assertError"],"mappings":";;;;;;;;AAiCO,SAAS,+BAA+B,OAAA,EAG5C;AACD,EAAA,MAAM,EAAE,YAAA,EAAc,yBAAA,EAA0B,GAAI,OAAA;AAEpD,EAAA,OAAOA,yCAAA,CAAqB;AAAA,IAC1B,EAAA,EAAI,sBAAA;AAAA,IACJ,WAAA,EAAa,6BAAA;AAAA,cACbC,oCAAA;AAAA,IACA,cAAA,EAAgB,IAAA;AAAA,IAChB,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO;AAAA,QACL,OAAA,EAAS,CAAA,CAAA,KACP,CAAA,CAAE,MAAA,CAAO;AAAA,UACP,WAAA,EACE;AAAA,SACH,CAAA;AAAA,QACH,KAAA,EAAO,CAAA,CAAA,KACL,CAAA,CAAE,MAAA,CAAO;AA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KAAA;AAAA,cACA,IAAA;AAAA,cACA,KAAA;AAAA,cACA,IAAA;AAAA,cACA,SAAA;AAAA,cACA,SAAA;AAAA,cACA;AAAA,aACD,CAAA;AAED,YAAA,OAAO;AAAA,cACL,QAAA,EAAU,SAAS,IAAA,CAAK,QAAA;AAAA,cACxB,MAAA,EAAQ,SAAS,IAAA,CAAK;AAAA,aACxB;AAAA,UACF;AAAA,SACD,CAAA;AAED,QAAA,IAAI,CAAC,KAAA,EAAO;AACV,UAAA,MAAM,IAAI,MAAM,wBAAwB,CAAA;AAAA,QAC1C;AAEA,QAAA,GAAA,CAAI,MAAA,CAAO,UAAA,EAAY,KAAA,CAAM,QAAQ,CAAA;AACrC,QAAA,GAAA,CAAI,MAAA,CAAO,aAAA,EAAe,KAAA,CAAM,MAAM,CAAA;AAEtC,QAAA,GAAA,CAAI,MAAA,CAAO,IAAA;AAAA,UACT,CAAA,4BAAA,EAA+B,KAAA,CAAM,MAAM,CAAA,EAAA,EAAK,MAAM,QAAQ,CAAA;AAAA,SAChE;AAAA,MACF,SAAS,CAAA,EAAG;AACV,QAAAC,kBAAA,CAAY,CAAC,CAAA;AACb,QAAA,GAAA,CAAI,MAAA,CAAO,IAAA;AAAA,UACT,2BAA2B,KAAK,CAAA,YAAA,EAAe,IAAI,CAAA,GAAA,EAAM,EAAE,OAAO,CAAA;AAAA,SACpE;AACA,QAAA,MAAM,CAAA;AAAA,MACR;AAAA,IACF;AAAA,GACD,CAAA;AACH;;;;"}
@@ -0,0 +1,82 @@
1
+ 'use strict';
2
+
3
+ var yaml = require('yaml');
4
+
5
+ function _interopNamespaceCompat(e) {
6
+ if (e && typeof e === 'object' && 'default' in e) return e;
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var yaml__namespace = /*#__PURE__*/_interopNamespaceCompat(yaml);
24
+
25
+ const examples = [
26
+ {
27
+ description: "Create a simple issue",
28
+ example: yaml__namespace.stringify({
29
+ steps: [
30
+ {
31
+ action: "github:issues:create",
32
+ name: "Create issue",
33
+ input: {
34
+ repoUrl: "github.com?repo=repo&owner=owner",
35
+ title: "Bug report",
36
+ body: "Found a bug that needs to be fixed"
37
+ }
38
+ }
39
+ ]
40
+ })
41
+ },
42
+ {
43
+ description: "Create an issue with labels and assignees",
44
+ example: yaml__namespace.stringify({
45
+ steps: [
46
+ {
47
+ action: "github:issues:create",
48
+ name: "Create issue with metadata",
49
+ input: {
50
+ repoUrl: "github.com?repo=repo&owner=owner",
51
+ title: "Feature request",
52
+ body: "This is a new feature request",
53
+ labels: ["enhancement", "needs-review"],
54
+ assignees: ["octocat"],
55
+ milestone: 1
56
+ }
57
+ }
58
+ ]
59
+ })
60
+ },
61
+ {
62
+ description: "Create an issue with specific token",
63
+ example: yaml__namespace.stringify({
64
+ steps: [
65
+ {
66
+ action: "github:issues:create",
67
+ name: "Create issue with token",
68
+ input: {
69
+ repoUrl: "github.com?repo=repo&owner=owner",
70
+ title: "Documentation update",
71
+ body: "Update the documentation for the new API",
72
+ labels: ["documentation"],
73
+ token: "gph_YourGitHubToken"
74
+ }
75
+ }
76
+ ]
77
+ })
78
+ }
79
+ ];
80
+
81
+ exports.examples = examples;
82
+ //# sourceMappingURL=githubIssuesCreate.examples.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"githubIssuesCreate.examples.cjs.js","sources":["../../src/actions/githubIssuesCreate.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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport * as yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Create a simple issue',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:issues:create',\n name: 'Create issue',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n title: 'Bug report',\n body: 'Found a bug that needs to be fixed',\n },\n },\n ],\n }),\n },\n {\n description: 'Create an issue with labels and assignees',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:issues:create',\n name: 'Create issue with metadata',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n title: 'Feature request',\n body: 'This is a new feature request',\n labels: ['enhancement', 'needs-review'],\n assignees: ['octocat'],\n milestone: 1,\n },\n },\n ],\n }),\n },\n {\n description: 'Create an issue with specific token',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:issues:create',\n name: 'Create issue with token',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n title: 'Documentation update',\n body: 'Update the documentation for the new API',\n labels: ['documentation'],\n token: 'gph_YourGitHubToken',\n },\n },\n ],\n }),\n },\n];\n"],"names":["yaml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAM,QAAA,GAA8B;AAAA,EACzC;AAAA,IACE,WAAA,EAAa,uBAAA;AAAA,IACb,OAAA,EAASA,gBAAK,SAAA,CAAU;AAAA,MACtB,KAAA,EAAO;AAAA,QACL;AAAA,UACE,MAAA,EAAQ,sBAAA;AAAA,UACR,IAAA,EAAM,cAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EAAS,kCAAA;AAAA,YACT,KAAA,EAAO,YAAA;AAAA,YACP,IAAA,EAAM;AAAA;AACR;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAA,EAAa,2CAAA;AAAA,IACb,OAAA,EAASA,gBAAK,SAAA,CAAU;AAAA,MACtB,KAAA,EAAO;AAAA,QACL;AAAA,UACE,MAAA,EAAQ,sBAAA;AAAA,UACR,IAAA,EAAM,4BAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EAAS,kCAAA;AAAA,YACT,KAAA,EAAO,iBAAA;AAAA,YACP,IAAA,EAAM,+BAAA;AAAA,YACN,MAAA,EAAQ,CAAC,aAAA,EAAe,cAAc,CAAA;AAAA,YACtC,SAAA,EAAW,CAAC,SAAS,CAAA;AAAA,YACrB,SAAA,EAAW;AAAA;AACb;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAA,EAAa,qCAAA;AAAA,IACb,OAAA,EAASA,gBAAK,SAAA,CAAU;AAAA,MACtB,KAAA,EAAO;AAAA,QACL;AAAA,UACE,MAAA,EAAQ,sBAAA;AAAA,UACR,IAAA,EAAM,yBAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EAAS,kCAAA;AAAA,YACT,KAAA,EAAO,sBAAA;AAAA,YACP,IAAA,EAAM,0CAAA;AAAA,YACN,MAAA,EAAQ,CAAC,eAAe,CAAA;AAAA,YACxB,KAAA,EAAO;AAAA;AACT;AACF;AACF,KACD;AAAA;AAEL;;;;"}
@@ -49,7 +49,8 @@ function createGithubRepoCreateAction(options) {
49
49
  requiredCommitSigning: inputProperties.requiredCommitSigning,
50
50
  requiredLinearHistory: inputProperties.requiredLinearHistory,
51
51
  customProperties: inputProperties.customProperties,
52
- subscribe: inputProperties.subscribe
52
+ subscribe: inputProperties.subscribe,
53
+ autoInit: inputProperties.autoInit
53
54
  },
54
55
  output: {
55
56
  remoteUrl: outputProperties.remoteUrl,
@@ -81,7 +82,8 @@ function createGithubRepoCreateAction(options) {
81
82
  oidcCustomization,
82
83
  customProperties,
83
84
  subscribe,
84
- token: providedToken
85
+ token: providedToken,
86
+ autoInit = void 0
85
87
  } = ctx.input;
86
88
  const { host, owner, repo } = pluginScaffolderNode.parseRepoUrl(repoUrl, integrations);
87
89
  if (!owner) {
@@ -128,7 +130,8 @@ function createGithubRepoCreateAction(options) {
128
130
  oidcCustomization,
129
131
  customProperties,
130
132
  subscribe,
131
- ctx.logger
133
+ ctx.logger,
134
+ autoInit
132
135
  );
133
136
  return newRepo.clone_url;
134
137
  }
@@ -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 id: 'github:repo:create',\n description: 'Creates a GitHub repository.',\n examples,\n schema: {\n input: {\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 output: {\n remoteUrl: outputProps.remoteUrl,\n repoContentsUrl: outputProps.repoContentsUrl,\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({\n ...octokitOptions,\n log: ctx.logger,\n });\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.repoContents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AAQ;AAAA,QACzB,GAAG,cAAA;AAAA,QACH,KAAK,GAAA,CAAI;AAAA,OACV,CAAA;AAED,MAAA,MAAM,SAAA,GAAY,MAAM,GAAA,CAAI,UAAA,CAAW;AAAA,QACrC,GAAA,EAAK,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,iBAAA;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,GAAA,CAAI;AAAA,WACN;AACA,UAAA,OAAO,OAAA,CAAQ,SAAA;AAAA,QACjB;AAAA,OACD,CAAA;AAED,MAAA,GAAA,CAAI,MAAA,CAAO,aAAa,SAAS,CAAA;AAAA,IACnC;AAAA,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 id: 'github:repo:create',\n description: 'Creates a GitHub repository.',\n examples,\n schema: {\n input: {\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 autoInit: inputProps.autoInit,\n },\n output: {\n remoteUrl: outputProps.remoteUrl,\n repoContentsUrl: outputProps.repoContentsUrl,\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 autoInit = undefined,\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({\n ...octokitOptions,\n log: ctx.logger,\n });\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 autoInit,\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","inputProps.autoInit","outputProps.remoteUrl","outputProps.repoContentsUrl","parseRepoUrl","InputError","getOctokitOptions","Octokit","createGithubRepoWithCollaboratorsAndTopics"],"mappings":";;;;;;;;;;;AAqCO,SAAS,6BAA6B,OAAA,EAG1C;AACD,EAAA,MAAM,EAAE,YAAA,EAAc,yBAAA,EAA0B,GAAI,OAAA;AAEpD,EAAA,OAAOA,yCAAA,CAAqB;AAAA,IAC1B,EAAA,EAAI,oBAAA;AAAA,IACJ,WAAA,EAAa,8BAAA;AAAA,cACbC,kCAAA;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO;AAAA,QACL,SAASC,uBAAW;AAAA,QACpB,aAAaC,2BAAW;AAAA,QACxB,UAAUC,wBAAW;AAAA,QACrB,QAAQC,sBAAW;AAAA,QACnB,yBAAyBC,uCAAW;AAAA,QACpC,6BAA6BC,2CAAW;AAAA,QACxC,8BA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A,wBAAA;AAAA,YACA,gBAAA;AAAA,YACA,cAAA;AAAA,YACA,iBAAA;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,GAAA,CAAI,MAAA;AAAA,YACJ;AAAA,WACF;AACA,UAAA,OAAO,OAAA,CAAQ,SAAA;AAAA,QACjB;AAAA,OACD,CAAA;AAED,MAAA,GAAA,CAAI,MAAA,CAAO,aAAa,SAAS,CAAA;AAAA,IACnC;AAAA,GACD,CAAA;AACH;;;;"}
@@ -972,6 +972,21 @@ const examples = [
972
972
  }
973
973
  ]
974
974
  })
975
+ },
976
+ {
977
+ description: "Create a repository with an initial commit.",
978
+ example: yaml__default.default.stringify({
979
+ steps: [
980
+ {
981
+ action: "github:repo:create",
982
+ name: "Create a new GitHub repository with an initial (signed) commit containing a README",
983
+ input: {
984
+ repoUrl: "github.com?repo=repo&owner=owner",
985
+ autoInit: true
986
+ }
987
+ }
988
+ ]
989
+ })
975
990
  }
976
991
  ];
977
992
 
@@ -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 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,QAAA,GAA8B;AAAA,EACzC;AAAA,IACE,WAAA,EAAa,yDAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAA,CAAU;AAAA,MACtB,KAAA,EAAO;AAAA,QACL;AAAA,UACE,MAAA,EAAQ,oBAAA;AAAA,UACR,IAAA,EAAM,gCAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EA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BAAA;AAAA,UACR,IAAA,EAAM,2GAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EAAS,kCAAA;AAAA,YACT,2BAAA,EAA6B,CAAC,UAAU,CAAA;AAAA,YACxC,8BAAA,EAAgC;AAAA;AAClC;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAA,EAAa,uBAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAA,CAAU;AAAA,MACtB,KAAA,EAAO;AAAA,QACL;AAAA,UACE,MAAA,EAAQ,oBAAA;AAAA,UACR,IAAA,EAAM,wDAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EAAS,kCAAA;AAAA,YACT,iBAAA,EAAmB;AAAA;AACrB;AACF;AACF,KACD;AAAA;AAEL;;;;"}
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 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 description: 'Create a repository with an initial commit.',\n example: yaml.stringify({\n steps: [\n {\n action: 'github:repo:create',\n name: 'Create a new GitHub repository with an initial (signed) commit containing a README',\n input: {\n repoUrl: 'github.com?repo=repo&owner=owner',\n autoInit: true,\n },\n },\n ],\n }),\n },\n];\n"],"names":["yaml"],"mappings":";;;;;;;;AAmBO,MAAM,QAAA,GAA8B;AAAA,EACzC;AAAA,IACE,WAAA,EAAa,yDAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAA,CAAU;AAAA,MACtB,KAAA,EAAO;AAAA,QACL;AAAA,UACE,MAAA,EAAQ,oBAAA;AAAA,UACR,IAAA,EAAM,gCAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EAAS;AAAA;AACX;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAA,EAAa,oBAAA;AAAA,IACb,OAAA,EAASA,s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A,EAA6B,CAAC,UAAU,CAAA;AAAA,YACxC,8BAAA,EAAgC;AAAA;AAClC;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAA,EAAa,uBAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAA,CAAU;AAAA,MACtB,KAAA,EAAO;AAAA,QACL;AAAA,UACE,MAAA,EAAQ,oBAAA;AAAA,UACR,IAAA,EAAM,wDAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EAAS,kCAAA;AAAA,YACT,iBAAA,EAAmB;AAAA;AACrB;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAA,EAAa,6CAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAA,CAAU;AAAA,MACtB,KAAA,EAAO;AAAA,QACL;AAAA,UACE,MAAA,EAAQ,oBAAA;AAAA,UACR,IAAA,EAAM,oFAAA;AAAA,UACN,KAAA,EAAO;AAAA,YACL,OAAA,EAAS,kCAAA;AAAA,YACT,QAAA,EAAU;AAAA;AACZ;AACF;AACF,KACD;AAAA;AAEL;;;;"}
@@ -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, allowUpdateBranch, 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, autoInit) {
13
13
  const user = await client.rest.users.getByUsername({
14
14
  username: owner
15
15
  });
@@ -35,6 +35,7 @@ async function createGithubRepoWithCollaboratorsAndTopics(client, repo, owner, r
35
35
  has_projects: hasProjects,
36
36
  has_wiki: hasWiki,
37
37
  has_issues: hasIssues,
38
+ auto_init: autoInit,
38
39
  // Custom properties only available on org repos
39
40
  custom_properties: customProperties
40
41
  }) : client.rest.repos.createForAuthenticatedUser({
@@ -52,7 +53,8 @@ async function createGithubRepoWithCollaboratorsAndTopics(client, repo, owner, r
52
53
  homepage,
53
54
  has_projects: hasProjects,
54
55
  has_wiki: hasWiki,
55
- has_issues: hasIssues
56
+ has_issues: hasIssues,
57
+ auto_init: autoInit
56
58
  });
57
59
  let newRepo;
58
60
  try {
@@ -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 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 | 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":";;;;;;;;;;;AAgCA,eAAsB,0CAAA,CACpB,MAAA,EACA,IAAA,EACA,KAAA,EACA,cAAA,EACA,WAAA,EACA,QAAA,EACA,mBAAA,EACA,gBAAA,EACA,gBAAA,EACA,sBAAA,EACA,wBAAA,EACA,gBAAA,EACA,gBACA,iBAAA,EACA,MAAA,EACA,aAAA,EAiBA,WAAA,EACA,OAAA,EACA,SAAA,EACA,MAAA,EACA,aAAA,EACA,OAAA,EACA,iBAAA,EAMA,gBAAA,EACA,SAAA,EACA,MAAA,EACA;AAEA,EAAA,MAAM,IAAA,GAAO,MAAM,MAAA,CAAO,IAAA,CAAK,MAAM,aAAA,CAAc;AAAA,IACjD,QAAA,EAAU;AAAA,GACX,CAAA;AAED,EAAA,IAAI,MAAA,EAAQ,UAAA,CAAW,CAAA,EAAG,KAAK,GAAG,CAAA,EAAG;AACnC,IAAA,MAAM,kBAAA,CAAmB,QAAQ,MAAM,CAAA;AAAA,EACzC;AAEA,EAAA,MAAM,mBAAA,GACJ,KAAK,IAAA,CAAK,IAAA,KAAS,iBACf,MAAA,CAAO,IAAA,CAAK,MAAM,WAAA,CAAY;AAAA,IAC5B,IAAA,EAAM,IAAA;AAAA,IACN,GAAA,EAAK,KAAA;AAAA,IACL,SAAS,cAAA,KAAmB,SAAA;AAAA;AAAA,IAE5B,UAAA,EAAY,cAAA;AAAA,IACZ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AAA;AAAA,QAAA,EACZ,GAAG,aAAa,SAAS,CAAA,6BAAA,CAAA;AAC7B,MAAA,MAAM,IAAIM,qBAAc,OAAO,CAAA;AAAA,IACjC;AAAA,EACF;AACF;AAEO,SAAS,mBAAA,CACd,kBACA,MAAA,EACoB;AACpB,EAAA,OAAO,gBAAA,GACH,gBAAA,GACA,MAAA,CAAO,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 | string[] } | undefined,\n subscribe: boolean | undefined,\n logger: LoggerService,\n autoInit?: boolean | undefined,\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 auto_init: autoInit,\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 auto_init: autoInit,\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":";;;;;;;;;;;AAgCA,eAAsB,0CAAA,CACpB,MAAA,EACA,IAAA,EACA,KAAA,EACA,cAAA,EACA,WAAA,EACA,QAAA,EACA,mBAAA,EACA,gBAAA,EACA,gBAAA,EACA,sBAAA,EACA,wBAAA,EACA,gBAAA,EACA,cAAA,EACA,iBAAA,EACA,MAAA,EACA,aAAA,EAiBA,WAAA,EACA,OAAA,EACA,SAAA,EACA,MAAA,EACA,aAAA,EACA,OAAA,EACA,iBAAA,EAMA,gBAAA,EACA,SAAA,EACA,MAAA,EACA,QAAA,EACA;AAEA,EAAA,MAAM,IAAA,GAAO,MAAM,MAAA,CAAO,IAAA,CAAK,MAAM,aAAA,CAAc;AAAA,IACjD,QAAA,EAAU;AAAA,GACX,CAAA;AAED,EAAA,IAAI,MAAA,EAAQ,UAAA,CAAW,CAAA,EAAG,KAAK,GAAG,CAAA,EAAG;AACnC,IAAA,MAAM,kBAAA,CAAmB,QAAQ,MAAM,CAAA;AAAA,EACzC;AAEA,EAAA,MAAM,mBAAA,GACJ,KAAK,IAAA,CAAK,IAAA,KAAS,iBACf,MAAA,CAAO,IAAA,CAAK,MAAM,WAAA,CAAY;AAAA,IAC5B,IAAA,EAAM,IAAA;AAAA,IACN,GAAA,EAAK,KAAA;AAAA,IACL,SAAS,cAAA,KAAmB,SAAA;AAAA;AAAA,IAE5B,UAAA,EAAY,cAAA;AAAA,IACZ,WAAA;AAAA,IACA,sBAAA,EAAwB,mBAAA;AAAA,IACxB,kBAAA,EAAoB,gBAAA;AAAA,IACpB,kBAAA,EAAoB,gBAAA;AAAA,IACpB,yBAAA,EAA2B,sBAAA;AAAA,IAC3B,2BAAA,EAA6B,wBAAA;AAAA,IAC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ACF;AACF;AAEO,SAAS,mBAAA,CACd,kBACA,MAAA,EACoB;AACpB,EAAA,OAAO,gBAAA,GACH,gBAAA,GACA,MAAA,CAAO,iBAAA,CAAkB,iCAAiC,CAAA;AAChE;;;;;;"}
@@ -145,6 +145,9 @@ const requiredCommitSigning = (z) => z.boolean({
145
145
  const requiredLinearHistory = (z) => z.boolean({
146
146
  description: `Prevent merge commits from being pushed to matching branches.`
147
147
  }).optional();
148
+ const blockCreations = (z) => z.boolean({
149
+ description: `Prevents creation of new branches during push, unless the push is initiated by a user, team, or app (defined in restrictions) which has the ability to push.`
150
+ }).default(false).optional();
148
151
  const repoVariables = (z) => z.record(z.string(), {
149
152
  description: "Variables attached to the repository"
150
153
  }).optional();
@@ -173,6 +176,9 @@ const subscribe = (z) => z.boolean({
173
176
  const branch = (z) => z.string({
174
177
  description: `The branch to protect. Defaults to the repository's default branch`
175
178
  }).optional();
179
+ const autoInit = (z) => z.boolean({
180
+ description: `Create an initial commit with empty README. Default is 'false'`
181
+ }).default(false).optional();
176
182
 
177
183
  exports.access = access;
178
184
  exports.allowAutoMerge = allowAutoMerge;
@@ -180,6 +186,8 @@ exports.allowMergeCommit = allowMergeCommit;
180
186
  exports.allowRebaseMerge = allowRebaseMerge;
181
187
  exports.allowSquashMerge = allowSquashMerge;
182
188
  exports.allowUpdateBranch = allowUpdateBranch;
189
+ exports.autoInit = autoInit;
190
+ exports.blockCreations = blockCreations;
183
191
  exports.branch = branch;
184
192
  exports.bypassPullRequestAllowances = bypassPullRequestAllowances;
185
193
  exports.collaborators = collaborators;
@@ -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 */\nimport { z as zod } from 'zod';\n\nconst repoUrl = (z: typeof zod) =>\n z.string({\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 });\n\nconst description = (z: typeof zod) =>\n z\n .string({\n description: 'Repository Description',\n })\n .optional();\n\nconst homepage = (z: typeof zod) =>\n z\n .string({\n description: 'Repository Homepage',\n })\n .optional();\n\nconst access = (z: typeof zod) =>\n z\n .string({\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 })\n .optional();\n\nconst requireCodeOwnerReviews = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Require an approved review in PR including files with a designated Code Owner',\n })\n .optional();\n\nconst dismissStaleReviews = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'New reviewable commits pushed to a matching branch will dismiss pull request review approvals.',\n })\n .optional();\n\nconst requiredStatusCheckContexts = (z: typeof zod) =>\n z\n .array(z.string(), {\n description:\n 'The list of status checks to require in order to merge into this branch',\n })\n .optional();\n\nconst requireBranchesToBeUpToDate = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Require branches to be up to date before merging. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst requiredConversationResolution = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Requires all conversations on code to be resolved before a pull request can be merged into this branch',\n })\n .optional();\n\nconst requireLastPushApproval = (z: typeof zod) =>\n z\n .boolean({\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 })\n .default(false)\n .optional();\n\nconst repoVisibility = (z: typeof zod) =>\n z\n .enum(['private', 'public', 'internal'], {\n description: 'Repository Visibility',\n })\n .optional();\n\nconst deleteBranchOnMerge = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Delete the branch after merging the PR. The default value is `false`',\n })\n .default(false)\n .optional();\n\nconst gitAuthorName = (z: typeof zod) =>\n z\n .string({\n description:\n 'Sets the default author name for the commit. The default value is `Scaffolder`',\n })\n .default('Scaffolder')\n .optional();\n\nconst gitAuthorEmail = (z: typeof zod) =>\n z\n .string({\n description: `Sets the default author email for the commit.`,\n })\n .optional();\n\nconst allowMergeCommit = (z: typeof zod) =>\n z\n .boolean({\n description: 'Allow merge commits. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst allowSquashMerge = (z: typeof zod) =>\n z\n .boolean({\n description: 'Allow squash merges. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst allowUpdateBranch = (z: typeof zod) =>\n z\n .boolean({\n description: 'Allow branch to be updated. The default value is `false`',\n })\n .default(false)\n .optional();\n\nconst squashMergeCommitTitle = (z: typeof zod) =>\n z\n .enum(['PR_TITLE', '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 })\n .default('COMMIT_OR_PR_TITLE')\n .optional();\n\nconst squashMergeCommitMessage = (z: typeof zod) =>\n z\n .enum(['PR_BODY', 'COMMIT_MESSAGES', 'BLANK'], {\n description:\n 'Sets the default value for a squash merge commit message. The default value is `COMMIT_MESSAGES`',\n })\n .default('COMMIT_MESSAGES')\n .optional();\n\nconst allowRebaseMerge = (z: typeof zod) =>\n z\n .boolean({\n description: 'Allow rebase merges. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst allowAutoMerge = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Allow individual PRs to merge automatically when all merge requirements are met. The default value is `false`',\n })\n .default(false)\n .optional();\n\nconst collaborators = (z: typeof zod) =>\n z\n .array(\n z.union([\n z.object({\n access: z.string({\n description: 'The type of access for the user',\n }),\n user: z.string({\n description:\n 'The name of the user that will be added as a collaborator',\n }),\n }),\n z.object({\n access: z.string({\n description: 'The type of access for the team',\n }),\n team: z.string({\n description:\n 'The name of the team that will be added as a collaborator',\n }),\n }),\n ]),\n {\n description: 'Provide additional users or teams with permissions',\n },\n )\n .optional();\n\nconst hasProjects = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Enable projects for the repository. The default value is `true` unless the organization has disabled repository projects',\n })\n .optional();\n\nconst hasWiki = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Enable the wiki for the repository. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst hasIssues = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Enable issues for the repository. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst token = (z: typeof zod) =>\n z\n .string({\n description: 'The token to use for authorization to GitHub',\n })\n .optional();\n\nconst topics = (z: typeof zod) =>\n z\n .array(z.string(), {\n description: 'Adds topics to the repository',\n })\n .optional();\n\nconst defaultBranch = (z: typeof zod) =>\n z\n .string({\n description: `Sets the default branch on the repository. The default value is 'master'`,\n })\n .default('master')\n .optional();\n\nconst protectDefaultBranch = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Protect the default branch after creating the repository. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst protectEnforceAdmins = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Enforce admins to adhere to default branch protection. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst bypassPullRequestAllowances = (z: typeof zod) =>\n z\n .object(\n {\n apps: z.array(z.string()).optional(),\n users: z.array(z.string()).optional(),\n teams: z.array(z.string()).optional(),\n },\n {\n description:\n 'Allow specific users, teams, or apps to bypass pull request requirements.',\n },\n )\n .optional();\n\nconst gitCommitMessage = (z: typeof zod) =>\n z\n .string({\n description:\n 'Sets the commit message on the repository. The default value is `initial commit`',\n })\n .default('initial commit')\n .optional();\n\nconst sourcePath = (z: typeof zod) =>\n z\n .string({\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 })\n .optional();\n\nconst requiredApprovingReviewCount = (z: typeof zod) =>\n z\n .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 .optional();\n\nconst restrictions = (z: typeof zod) =>\n z\n .object(\n {\n apps: z.array(z.string()).optional(),\n users: z.array(z.string()),\n teams: z.array(z.string()),\n },\n {\n description:\n 'Restrict who can push to the protected branch. User, app, and team restrictions are only available for organization-owned repositories.',\n },\n )\n .optional();\n\nconst requiredCommitSigning = (z: typeof zod) =>\n z\n .boolean({\n description: `Require commit signing so that you must sign commits on this branch.`,\n })\n .optional();\n\nconst requiredLinearHistory = (z: typeof zod) =>\n z\n .boolean({\n description: `Prevent merge commits from being pushed to matching branches.`,\n })\n .optional();\n\nconst repoVariables = (z: typeof zod) =>\n z\n .record(z.string(), {\n description: 'Variables attached to the repository',\n })\n .optional();\n\nconst secrets = (z: typeof zod) =>\n z\n .record(z.string(), {\n description: 'Secrets attached to the repository',\n })\n .optional();\n\nconst oidcCustomization = (z: typeof zod) =>\n z\n .object(\n {\n useDefault: z\n .boolean({\n description: `Whether to use the default template or not. If true, includeClaimKeys must not be set.`,\n })\n .default(true),\n includeClaimKeys: z\n .array(z.string(), {\n description: `Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.`,\n })\n .optional(),\n },\n {\n description: `OIDC customization template attached to the repository.`,\n },\n )\n .optional();\n\nconst customProperties = (z: typeof zod) =>\n z\n .record(z.union([z.string(), z.array(z.string())]), {\n description:\n 'Custom properties to be added to the repository (note, this only works for organization repositories). All values must be strings',\n })\n .optional();\n\nconst subscribe = (z: typeof zod) =>\n z\n .boolean({\n description: `Subscribe to the repository. The default value is 'false'`,\n })\n .optional();\n\nconst branch = (z: typeof zod) =>\n z\n .string({\n description: `The branch to protect. Defaults to the repository's default branch`,\n })\n .optional();\n\nexport {\n repoUrl,\n description,\n homepage,\n access,\n requireCodeOwnerReviews,\n dismissStaleReviews,\n requiredStatusCheckContexts,\n requireBranchesToBeUpToDate,\n requiredConversationResolution,\n requireLastPushApproval,\n repoVisibility,\n deleteBranchOnMerge,\n gitAuthorName,\n gitAuthorEmail,\n allowMergeCommit,\n allowSquashMerge,\n allowUpdateBranch,\n squashMergeCommitTitle,\n squashMergeCommitMessage,\n allowRebaseMerge,\n allowAutoMerge,\n collaborators,\n hasProjects,\n hasWiki,\n hasIssues,\n token,\n topics,\n defaultBranch,\n gitCommitMessage,\n sourcePath,\n repoVariables,\n secrets,\n oidcCustomization,\n customProperties,\n subscribe,\n requiredApprovingReviewCount,\n restrictions,\n requiredCommitSigning,\n requiredLinearHistory,\n protectDefaultBranch,\n protectEnforceAdmins,\n bypassPullRequestAllowances,\n branch,\n};\n"],"names":[],"mappings":";;AAiBA,MAAM,OAAA,GAAU,CAAC,CAAA,KACf,CAAA,CAAE,MAAA,CAAO;AAAA,EACP,WAAA,EACE;AACJ,CAAC;AAEH,MAAM,WAAA,GAAc,CAAC,CAAA,KACnB,CAAA,CACG,MAAA,CAAO;AAAA,EACN,WAAA,EAAa;AACf,CAAC,EACA,QAAA;AAEL,MAAM,QAAA,GAAW,CAAC,CAAA,KAChB,CAAA,CACG,MAAA,CAAO;AAAA,EACN,WAAA,EAAa;AACf,CAAC,EACA,QAAA;AAEL,MAAM,MAAA,GAAS,CAAC,CAAA,KACd,CAAA,CACG,MAAA,CAAO;AAAA,EACN,WAAA,EACE;AACJ,CAAC,EACA,QAAA;AAEL,MAAM,uBAAA,GAA0B,CAAC,CAAA,KAC/B,CAAA,CACG,OAAA,CAAQ;AAAA,EACP,WAAA,EACE;AACJ,CAAC,EACA,QAAA;AAEL,MAAM,mBAAA,GAAsB,CAAC,CAAA,KAC3B,CAAA,CACG,OAAA,CAAQ;AAAA,EACP,WAAA,EACE;AACJ,CAAC,EACA,QAAA;AAEL,MAAM,8BAA8B,CAAC,CAAA,KACnC,EACG,KAAA,CAAM,CAAA,CAAE,QAAO,EAAG;AAAA,EACjB,WAAA,EACE;AACJ,CAAC,EACA,QAAA;AAEL,MAAM,2BAAA,GAA8B,CAAC,CAAA,KACnC,CAAA,CACG,OAAA,CAAQ;AA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,EACN,WAAA,EAAa,CAAA,kEAAA;AACf,CAAC,EACA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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 */\nimport { z as zod } from 'zod';\n\nconst repoUrl = (z: typeof zod) =>\n z.string({\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 });\n\nconst description = (z: typeof zod) =>\n z\n .string({\n description: 'Repository Description',\n })\n .optional();\n\nconst homepage = (z: typeof zod) =>\n z\n .string({\n description: 'Repository Homepage',\n })\n .optional();\n\nconst access = (z: typeof zod) =>\n z\n .string({\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 })\n .optional();\n\nconst requireCodeOwnerReviews = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Require an approved review in PR including files with a designated Code Owner',\n })\n .optional();\n\nconst dismissStaleReviews = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'New reviewable commits pushed to a matching branch will dismiss pull request review approvals.',\n })\n .optional();\n\nconst requiredStatusCheckContexts = (z: typeof zod) =>\n z\n .array(z.string(), {\n description:\n 'The list of status checks to require in order to merge into this branch',\n })\n .optional();\n\nconst requireBranchesToBeUpToDate = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Require branches to be up to date before merging. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst requiredConversationResolution = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Requires all conversations on code to be resolved before a pull request can be merged into this branch',\n })\n .optional();\n\nconst requireLastPushApproval = (z: typeof zod) =>\n z\n .boolean({\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 })\n .default(false)\n .optional();\n\nconst repoVisibility = (z: typeof zod) =>\n z\n .enum(['private', 'public', 'internal'], {\n description: 'Repository Visibility',\n })\n .optional();\n\nconst deleteBranchOnMerge = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Delete the branch after merging the PR. The default value is `false`',\n })\n .default(false)\n .optional();\n\nconst gitAuthorName = (z: typeof zod) =>\n z\n .string({\n description:\n 'Sets the default author name for the commit. The default value is `Scaffolder`',\n })\n .default('Scaffolder')\n .optional();\n\nconst gitAuthorEmail = (z: typeof zod) =>\n z\n .string({\n description: `Sets the default author email for the commit.`,\n })\n .optional();\n\nconst allowMergeCommit = (z: typeof zod) =>\n z\n .boolean({\n description: 'Allow merge commits. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst allowSquashMerge = (z: typeof zod) =>\n z\n .boolean({\n description: 'Allow squash merges. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst allowUpdateBranch = (z: typeof zod) =>\n z\n .boolean({\n description: 'Allow branch to be updated. The default value is `false`',\n })\n .default(false)\n .optional();\n\nconst squashMergeCommitTitle = (z: typeof zod) =>\n z\n .enum(['PR_TITLE', '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 })\n .default('COMMIT_OR_PR_TITLE')\n .optional();\n\nconst squashMergeCommitMessage = (z: typeof zod) =>\n z\n .enum(['PR_BODY', 'COMMIT_MESSAGES', 'BLANK'], {\n description:\n 'Sets the default value for a squash merge commit message. The default value is `COMMIT_MESSAGES`',\n })\n .default('COMMIT_MESSAGES')\n .optional();\n\nconst allowRebaseMerge = (z: typeof zod) =>\n z\n .boolean({\n description: 'Allow rebase merges. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst allowAutoMerge = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Allow individual PRs to merge automatically when all merge requirements are met. The default value is `false`',\n })\n .default(false)\n .optional();\n\nconst collaborators = (z: typeof zod) =>\n z\n .array(\n z.union([\n z.object({\n access: z.string({\n description: 'The type of access for the user',\n }),\n user: z.string({\n description:\n 'The name of the user that will be added as a collaborator',\n }),\n }),\n z.object({\n access: z.string({\n description: 'The type of access for the team',\n }),\n team: z.string({\n description:\n 'The name of the team that will be added as a collaborator',\n }),\n }),\n ]),\n {\n description: 'Provide additional users or teams with permissions',\n },\n )\n .optional();\n\nconst hasProjects = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Enable projects for the repository. The default value is `true` unless the organization has disabled repository projects',\n })\n .optional();\n\nconst hasWiki = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Enable the wiki for the repository. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst hasIssues = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Enable issues for the repository. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst token = (z: typeof zod) =>\n z\n .string({\n description: 'The token to use for authorization to GitHub',\n })\n .optional();\n\nconst topics = (z: typeof zod) =>\n z\n .array(z.string(), {\n description: 'Adds topics to the repository',\n })\n .optional();\n\nconst defaultBranch = (z: typeof zod) =>\n z\n .string({\n description: `Sets the default branch on the repository. The default value is 'master'`,\n })\n .default('master')\n .optional();\n\nconst protectDefaultBranch = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Protect the default branch after creating the repository. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst protectEnforceAdmins = (z: typeof zod) =>\n z\n .boolean({\n description:\n 'Enforce admins to adhere to default branch protection. The default value is `true`',\n })\n .default(true)\n .optional();\n\nconst bypassPullRequestAllowances = (z: typeof zod) =>\n z\n .object(\n {\n apps: z.array(z.string()).optional(),\n users: z.array(z.string()).optional(),\n teams: z.array(z.string()).optional(),\n },\n {\n description:\n 'Allow specific users, teams, or apps to bypass pull request requirements.',\n },\n )\n .optional();\n\nconst gitCommitMessage = (z: typeof zod) =>\n z\n .string({\n description:\n 'Sets the commit message on the repository. The default value is `initial commit`',\n })\n .default('initial commit')\n .optional();\n\nconst sourcePath = (z: typeof zod) =>\n z\n .string({\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 })\n .optional();\n\nconst requiredApprovingReviewCount = (z: typeof zod) =>\n z\n .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 .optional();\n\nconst restrictions = (z: typeof zod) =>\n z\n .object(\n {\n apps: z.array(z.string()).optional(),\n users: z.array(z.string()),\n teams: z.array(z.string()),\n },\n {\n description:\n 'Restrict who can push to the protected branch. User, app, and team restrictions are only available for organization-owned repositories.',\n },\n )\n .optional();\n\nconst requiredCommitSigning = (z: typeof zod) =>\n z\n .boolean({\n description: `Require commit signing so that you must sign commits on this branch.`,\n })\n .optional();\n\nconst requiredLinearHistory = (z: typeof zod) =>\n z\n .boolean({\n description: `Prevent merge commits from being pushed to matching branches.`,\n })\n .optional();\n\nconst blockCreations = (z: typeof zod) =>\n z\n .boolean({\n description: `Prevents creation of new branches during push, unless the push is initiated by a user, team, or app (defined in restrictions) which has the ability to push.`,\n })\n .default(false)\n .optional();\n\nconst repoVariables = (z: typeof zod) =>\n z\n .record(z.string(), {\n description: 'Variables attached to the repository',\n })\n .optional();\n\nconst secrets = (z: typeof zod) =>\n z\n .record(z.string(), {\n description: 'Secrets attached to the repository',\n })\n .optional();\n\nconst oidcCustomization = (z: typeof zod) =>\n z\n .object(\n {\n useDefault: z\n .boolean({\n description: `Whether to use the default template or not. If true, includeClaimKeys must not be set.`,\n })\n .default(true),\n includeClaimKeys: z\n .array(z.string(), {\n description: `Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.`,\n })\n .optional(),\n },\n {\n description: `OIDC customization template attached to the repository.`,\n },\n )\n .optional();\n\nconst customProperties = (z: typeof zod) =>\n z\n .record(z.union([z.string(), z.array(z.string())]), {\n description:\n 'Custom properties to be added to the repository (note, this only works for organization repositories). All values must be strings',\n })\n .optional();\n\nconst subscribe = (z: typeof zod) =>\n z\n .boolean({\n description: `Subscribe to the repository. The default value is 'false'`,\n })\n .optional();\n\nconst branch = (z: typeof zod) =>\n z\n .string({\n description: `The branch to protect. Defaults to the repository's default branch`,\n })\n .optional();\n\nconst autoInit = (z: typeof zod) =>\n z\n .boolean({\n description: `Create an initial commit with empty README. Default is 'false'`,\n })\n .default(false)\n .optional();\n\nexport {\n repoUrl,\n description,\n homepage,\n access,\n requireCodeOwnerReviews,\n dismissStaleReviews,\n requiredStatusCheckContexts,\n requireBranchesToBeUpToDate,\n requiredConversationResolution,\n requireLastPushApproval,\n repoVisibility,\n deleteBranchOnMerge,\n gitAuthorName,\n gitAuthorEmail,\n allowMergeCommit,\n allowSquashMerge,\n allowUpdateBranch,\n squashMergeCommitTitle,\n squashMergeCommitMessage,\n allowRebaseMerge,\n allowAutoMerge,\n collaborators,\n hasProjects,\n hasWiki,\n hasIssues,\n token,\n topics,\n defaultBranch,\n gitCommitMessage,\n sourcePath,\n repoVariables,\n secrets,\n oidcCustomization,\n customProperties,\n subscribe,\n requiredApprovingReviewCount,\n restrictions,\n requiredCommitSigning,\n requiredLinearHistory,\n protectDefaultBranch,\n protectEnforceAdmins,\n bypassPullRequestAllowances,\n branch,\n blockCreations,\n autoInit,\n};\n"],"names":[],"mappings":";;AAiBA,MAAM,OAAA,GAAU,CAAC,CAAA,KACf,CAAA,CAAE,MAAA,CAAO;AAAA,EACP,WAAA,EACE;AACJ,CAAC;AAEH,MAAM,WAAA,GAAc,CAAC,CAAA,KACnB,CAAA,CACG,MAAA,CAAO;AAAA,EACN,WAAA,EAAa;AACf,CAAC,EACA,QAAA;AAEL,MAAM,QAAA,GAAW,CAAC,CAAA,KAChB,CAAA,CACG,M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AA,IACE,UAAA,EAAY,EACT,OAAA,CAAQ;AAAA,MACP,WAAA,EAAa,CAAA,sFAAA;AAAA,KACd,CAAA,CACA,OAAA,CAAQ,IAAI,CAAA;AAAA,IACf,gBAAA,EAAkB,CAAA,CACf,KAAA,CAAM,CAAA,CAAE,QAAO,EAAG;AAAA,MACjB,WAAA,EAAa,CAAA,iGAAA;AAAA,KACd,EACA,QAAA;AAAS,GACd;AAAA,EACA;AAAA,IACE,WAAA,EAAa,CAAA,uDAAA;AAAA;AAEjB,CAAA,CACC,QAAA;AAEL,MAAM,mBAAmB,CAAC,CAAA,KACxB,EACG,MAAA,CAAO,CAAA,CAAE,MAAM,CAAC,CAAA,CAAE,MAAA,EAAO,EAAG,EAAE,KAAA,CAAM,CAAA,CAAE,QAAQ,CAAC,CAAC,CAAA,EAAG;AAAA,EAClD,WAAA,EACE;AACJ,CAAC,EACA,QAAA;AAEL,MAAM,SAAA,GAAY,CAAC,CAAA,KACjB,CAAA,CACG,OAAA,CAAQ;AAAA,EACP,WAAA,EAAa,CAAA,yDAAA;AACf,CAAC,EACA,QAAA;AAEL,MAAM,MAAA,GAAS,CAAC,CAAA,KACd,CAAA,CACG,MAAA,CAAO;AAAA,EACN,WAAA,EAAa,CAAA,kEAAA;AACf,CAAC,EACA,QAAA;AAEL,MAAM,QAAA,GAAW,CAAC,CAAA,KAChB,CAAA,CACG,OAAA,CAAQ;AAAA,EACP,WAAA,EAAa,CAAA,8DAAA;AACf,CAAC,CAAA,CACA,OAAA,CAAQ,KAAK,CAAA,CACb,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.cjs.js CHANGED
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var githubActionsDispatch = require('./actions/githubActionsDispatch.cjs.js');
6
6
  var githubIssuesLabel = require('./actions/githubIssuesLabel.cjs.js');
7
+ var githubIssuesCreate = require('./actions/githubIssuesCreate.cjs.js');
7
8
  var githubRepoCreate = require('./actions/githubRepoCreate.cjs.js');
8
9
  var githubRepoPush = require('./actions/githubRepoPush.cjs.js');
9
10
  var githubWebhook = require('./actions/githubWebhook.cjs.js');
@@ -21,6 +22,7 @@ var util = require('./util.cjs.js');
21
22
 
22
23
  exports.createGithubActionsDispatchAction = githubActionsDispatch.createGithubActionsDispatchAction;
23
24
  exports.createGithubIssuesLabelAction = githubIssuesLabel.createGithubIssuesLabelAction;
25
+ exports.createGithubIssuesCreateAction = githubIssuesCreate.createGithubIssuesCreateAction;
24
26
  exports.createGithubRepoCreateAction = githubRepoCreate.createGithubRepoCreateAction;
25
27
  exports.createGithubRepoPushAction = githubRepoPush.createGithubRepoPushAction;
26
28
  exports.createGithubWebhookAction = githubWebhook.createGithubWebhookAction;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -40,6 +40,26 @@ declare function createGithubIssuesLabelAction(options: {
40
40
  [x: string]: any;
41
41
  }, "v2">;
42
42
 
43
+ /**
44
+ * Creates an issue on GitHub
45
+ * @public
46
+ */
47
+ declare function createGithubIssuesCreateAction(options: {
48
+ integrations: ScmIntegrationRegistry;
49
+ githubCredentialsProvider?: GithubCredentialsProvider;
50
+ }): _backstage_plugin_scaffolder_node.TemplateAction<{
51
+ repoUrl: string;
52
+ title: string;
53
+ body?: string | undefined;
54
+ assignees?: string[] | undefined;
55
+ milestone?: string | number | undefined;
56
+ labels?: string[] | undefined;
57
+ token?: string | undefined;
58
+ }, {
59
+ issueUrl: string;
60
+ issueNumber: number;
61
+ }, "v2">;
62
+
43
63
  /**
44
64
  * Creates a new action that initializes a git repository
45
65
  *
@@ -99,6 +119,7 @@ declare function createGithubRepoCreateAction(options: {
99
119
  requiredLinearHistory?: boolean | undefined;
100
120
  customProperties?: Record<string, string | string[]> | undefined;
101
121
  subscribe?: boolean | undefined;
122
+ autoInit?: boolean | undefined;
102
123
  }, {
103
124
  remoteUrl: string;
104
125
  repoContentsUrl: string;
@@ -426,6 +447,7 @@ declare function createGithubBranchProtectionAction(options: {
426
447
  requireLastPushApproval?: boolean | undefined;
427
448
  requiredCommitSigning?: boolean | undefined;
428
449
  requiredLinearHistory?: boolean | undefined;
450
+ blockCreations?: boolean | undefined;
429
451
  token?: string | undefined;
430
452
  }, {
431
453
  [x: string]: any;
@@ -463,4 +485,4 @@ declare function getOctokitOptions(options: {
463
485
  repoUrl: string;
464
486
  }): Promise<OctokitOptions>;
465
487
 
466
- export { type CreateGithubPullRequestActionOptions, createGithubActionsDispatchAction, createGithubAutolinksAction, createGithubBranchProtectionAction, createGithubDeployKeyAction, createGithubEnvironmentAction, createGithubIssuesLabelAction, createGithubPagesEnableAction, createGithubRepoCreateAction, createGithubRepoPushAction, createGithubWebhookAction, createPublishGithubAction, createPublishGithubPullRequestAction, githubModule as default, getOctokitOptions };
488
+ export { type CreateGithubPullRequestActionOptions, createGithubActionsDispatchAction, createGithubAutolinksAction, createGithubBranchProtectionAction, createGithubDeployKeyAction, createGithubEnvironmentAction, createGithubIssuesCreateAction, createGithubIssuesLabelAction, createGithubPagesEnableAction, createGithubRepoCreateAction, createGithubRepoPushAction, createGithubWebhookAction, createPublishGithubAction, createPublishGithubPullRequestAction, githubModule as default, getOctokitOptions };
@@ -4,6 +4,7 @@ var backendPluginApi = require('@backstage/backend-plugin-api');
4
4
  var alpha = require('@backstage/plugin-scaffolder-node/alpha');
5
5
  var githubActionsDispatch = require('./actions/githubActionsDispatch.cjs.js');
6
6
  var githubIssuesLabel = require('./actions/githubIssuesLabel.cjs.js');
7
+ var githubIssuesCreate = require('./actions/githubIssuesCreate.cjs.js');
7
8
  var githubRepoCreate = require('./actions/githubRepoCreate.cjs.js');
8
9
  var githubRepoPush = require('./actions/githubRepoPush.cjs.js');
9
10
  var githubWebhook = require('./actions/githubWebhook.cjs.js');
@@ -52,6 +53,10 @@ const githubModule = backendPluginApi.createBackendModule({
52
53
  integrations,
53
54
  githubCredentialsProvider
54
55
  }),
56
+ githubIssuesCreate.createGithubIssuesCreateAction({
57
+ integrations,
58
+ githubCredentialsProvider
59
+ }),
55
60
  githubRepoCreate.createGithubRepoCreateAction({
56
61
  integrations,
57
62
  githubCredentialsProvider
@@ -1 +1 @@
1
- {"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport {\n scaffolderActionsExtensionPoint,\n scaffolderAutocompleteExtensionPoint,\n} from '@backstage/plugin-scaffolder-node/alpha';\nimport {\n createGithubActionsDispatchAction,\n createGithubAutolinksAction,\n createGithubDeployKeyAction,\n createGithubEnvironmentAction,\n createGithubIssuesLabelAction,\n createGithubRepoCreateAction,\n createGithubRepoPushAction,\n createGithubWebhookAction,\n createPublishGithubAction,\n createPublishGithubPullRequestAction,\n createGithubPagesEnableAction,\n createGithubBranchProtectionAction,\n} from './actions';\nimport {\n DefaultGithubCredentialsProvider,\n ScmIntegrations,\n} from '@backstage/integration';\nimport { createHandleAutocompleteRequest } from './autocomplete/autocomplete';\nimport { catalogServiceRef } from '@backstage/plugin-catalog-node';\n\n/**\n * @public\n * The GitHub Module for the Scaffolder Backend\n */\nexport const githubModule = createBackendModule({\n pluginId: 'scaffolder',\n moduleId: 'github',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n config: coreServices.rootConfig,\n catalog: catalogServiceRef,\n autocomplete: scaffolderAutocompleteExtensionPoint,\n },\n async init({ scaffolder, config, autocomplete, catalog }) {\n const integrations = ScmIntegrations.fromConfig(config);\n const githubCredentialsProvider =\n DefaultGithubCredentialsProvider.fromIntegrations(integrations);\n\n scaffolder.addActions(\n createGithubActionsDispatchAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubAutolinksAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubDeployKeyAction({\n integrations,\n }),\n createGithubEnvironmentAction({\n integrations,\n catalog,\n }),\n createGithubIssuesLabelAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubRepoCreateAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubRepoPushAction({ integrations, config }),\n createGithubWebhookAction({\n integrations,\n githubCredentialsProvider,\n }),\n createPublishGithubAction({\n integrations,\n config,\n githubCredentialsProvider,\n }),\n createPublishGithubPullRequestAction({\n integrations,\n githubCredentialsProvider,\n config,\n }),\n createGithubPagesEnableAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubBranchProtectionAction({\n integrations,\n }),\n );\n\n autocomplete.addAutocompleteProvider({\n id: 'github',\n handler: createHandleAutocompleteRequest({ integrations }),\n });\n },\n });\n },\n});\n"],"names":["createBackendModule","scaffolderActionsExtensionPoint","coreServices","catalogServiceRef","scaffolderAutocompleteExtensionPoint","autocomplete","ScmIntegrations","DefaultGithubCredentialsProvider","createGithubActionsDispatchAction","createGithubAutolinksAction","createGithubDeployKeyAction","createGithubEnvironmentAction","createGithubIssuesLabelAction","createGithubRepoCreateAction","createGithubRepoPushAction","createGithubWebhookAction","createPublishGithubAction","createPublishGithubPullRequestAction","createGithubPagesEnableAction","createGithubBranchProtectionAction","createHandleAutocompleteRequest"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgDO,MAAM,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AA,CAAqC;AAAA,YACnC,YAAA;AAAA,YACA,yBAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,+CAAA,CAA8B;AAAA,YAC5B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,yDAAA,CAAmC;AAAA,YACjC;AAAA,WACD;AAAA,SACH;AAEA,QAAAd,cAAA,CAAa,uBAAA,CAAwB;AAAA,UACnC,EAAA,EAAI,QAAA;AAAA,UACJ,OAAA,EAASe,4CAAA,CAAgC,EAAE,YAAA,EAAc;AAAA,SAC1D,CAAA;AAAA,MACH;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport {\n scaffolderActionsExtensionPoint,\n scaffolderAutocompleteExtensionPoint,\n} from '@backstage/plugin-scaffolder-node/alpha';\nimport {\n createGithubActionsDispatchAction,\n createGithubAutolinksAction,\n createGithubDeployKeyAction,\n createGithubEnvironmentAction,\n createGithubIssuesLabelAction,\n createGithubIssuesCreateAction,\n createGithubRepoCreateAction,\n createGithubRepoPushAction,\n createGithubWebhookAction,\n createPublishGithubAction,\n createPublishGithubPullRequestAction,\n createGithubPagesEnableAction,\n createGithubBranchProtectionAction,\n} from './actions';\nimport {\n DefaultGithubCredentialsProvider,\n ScmIntegrations,\n} from '@backstage/integration';\nimport { createHandleAutocompleteRequest } from './autocomplete/autocomplete';\nimport { catalogServiceRef } from '@backstage/plugin-catalog-node';\n\n/**\n * @public\n * The GitHub Module for the Scaffolder Backend\n */\nexport const githubModule = createBackendModule({\n pluginId: 'scaffolder',\n moduleId: 'github',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n config: coreServices.rootConfig,\n catalog: catalogServiceRef,\n autocomplete: scaffolderAutocompleteExtensionPoint,\n },\n async init({ scaffolder, config, autocomplete, catalog }) {\n const integrations = ScmIntegrations.fromConfig(config);\n const githubCredentialsProvider =\n DefaultGithubCredentialsProvider.fromIntegrations(integrations);\n\n scaffolder.addActions(\n createGithubActionsDispatchAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubAutolinksAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubDeployKeyAction({\n integrations,\n }),\n createGithubEnvironmentAction({\n integrations,\n catalog,\n }),\n createGithubIssuesLabelAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubIssuesCreateAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubRepoCreateAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubRepoPushAction({ integrations, config }),\n createGithubWebhookAction({\n integrations,\n githubCredentialsProvider,\n }),\n createPublishGithubAction({\n integrations,\n config,\n githubCredentialsProvider,\n }),\n createPublishGithubPullRequestAction({\n integrations,\n githubCredentialsProvider,\n config,\n }),\n createGithubPagesEnableAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubBranchProtectionAction({\n integrations,\n }),\n );\n\n autocomplete.addAutocompleteProvider({\n id: 'github',\n handler: createHandleAutocompleteRequest({ integrations }),\n });\n },\n });\n },\n});\n"],"names":["createBackendModule","scaffolderActionsExtensionPoint","coreServices","catalogServiceRef","scaffolderAutocompleteExtensionPoint","autocomplete","ScmIntegrations","DefaultGithubCredentialsProvider","createGithubActionsDispatchAction","createGithubAutolinksAction","createGithubDeployKeyAction","createGithubEnvironmentAction","createGithubIssuesLabelAction","createGithubIssuesCreateAction","createGithubRepoCreateAction","createGithubRepoPushAction","createGithubWebhookAction","createPublishGithubAction","createPublishGithubPullRequestAction","createGithubPagesEnableAction","createGithubBranchProtectionAction","createHandleAutocompleteRequest"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiDO,MAAM,eAAeA,oCAAA,CAAoB;AAAA,EAC9C,QAAA,EAAU,YAAA;AAAA,EACV,QAAA,EAAU,QAAA;AAAA,EACV,QAAA,CAAS,EAAE,YAAA,EAAa,EAAG;AACzB,IAAA,YAAA,CAAa;AAAA,MACX,IAAA,EAAM;AAAA,QACJ,UAAA,EAAYC,qCAAA;AAAA,QACZ,QAAQC,6BAAA,CAAa,UAAA;AAAA,QACrB,OAAA,EAASC,mCAAA;AAAA,QACT,YAAA,EAAcC;AAAA,OAChB;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,YAAY,MAAA,gBAAQC,cAAA,EAAc,SAAQ,EAAG;AACxD,QAAA,MAAM,YAAA,GAAeC,2BAAA,CAAgB,UAAA,CAAW,MAAM,CAAA;AACtD,QAAA,MAAM,yBAAA,GACJC,4CAAA,CAAiC,gBAAA,CAAiB,YAAY,CAAA;AAEhE,QAAA,UAAA,CAAW,UAAA;AAAA,UACTC,uDAAA,CAAkC;AAAA,YAChC,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,2CAAA,CAA4B;AAAA,YAC1B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,2CAAA,CAA4B;AAAA,YAC1B;AAAA,WACD,CAAA;AAAA,UACDC,+CAAA,CAA8B;AAAA,YAC5B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,+CAAA,CAA8B;AAAA,YAC5B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,iDAAA,CAA+B;AAAA,YAC7B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,6CAAA,CAA6B;AAAA,YAC3B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,yCAAA,CAA2B,EAAE,YAAA,EAAc,MAAA,EAAQ,CAAA;AAAA,UACnDC,uCAAA,CAA0B;AAAA,YACxB,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,gCAAA,CAA0B;AAAA,YACxB,YAAA;AAAA,YACA,MAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,sDAAA,CAAqC;AAAA,YACnC,YAAA;AAAA,YACA,yBAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,+CAAA,CAA8B;AAAA,YAC5B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,yDAAA,CAAmC;AAAA,YACjC;AAAA,WACD;AAAA,SACH;AAEA,QAAAf,cAAA,CAAa,uBAAA,CAAwB;AAAA,UACnC,EAAA,EAAI,QAAA;AAAA,UACJ,OAAA,EAASgB,4CAAA,CAAgC,EAAE,YAAA,EAAc;AAAA,SAC1D,CAAA;AAAA,MACH;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend-module-github",
3
- "version": "0.8.3-next.1",
3
+ "version": "0.9.0",
4
4
  "description": "The github module for @backstage/plugin-scaffolder-backend",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -50,14 +50,14 @@
50
50
  "test": "backstage-cli package test"
51
51
  },
52
52
  "dependencies": {
53
- "@backstage/backend-plugin-api": "1.4.3-next.0",
54
- "@backstage/catalog-model": "1.7.5",
55
- "@backstage/config": "1.3.3",
56
- "@backstage/errors": "1.2.7",
57
- "@backstage/integration": "1.18.0-next.0",
58
- "@backstage/plugin-catalog-node": "1.19.0-next.1",
59
- "@backstage/plugin-scaffolder-node": "0.11.1-next.0",
60
- "@backstage/types": "1.2.1",
53
+ "@backstage/backend-plugin-api": "^1.4.3",
54
+ "@backstage/catalog-model": "^1.7.5",
55
+ "@backstage/config": "^1.3.3",
56
+ "@backstage/errors": "^1.2.7",
57
+ "@backstage/integration": "^1.18.0",
58
+ "@backstage/plugin-catalog-node": "^1.19.0",
59
+ "@backstage/plugin-scaffolder-node": "^0.11.1",
60
+ "@backstage/types": "^1.2.2",
61
61
  "@octokit/webhooks": "^10.9.2",
62
62
  "libsodium-wrappers": "^0.7.11",
63
63
  "octokit": "^3.0.0",
@@ -66,9 +66,9 @@
66
66
  "zod": "^3.22.4"
67
67
  },
68
68
  "devDependencies": {
69
- "@backstage/backend-test-utils": "1.9.0-next.1",
70
- "@backstage/cli": "0.34.2-next.2",
71
- "@backstage/plugin-scaffolder-node-test-utils": "0.3.3-next.1",
69
+ "@backstage/backend-test-utils": "^1.9.0",
70
+ "@backstage/cli": "^0.34.2",
71
+ "@backstage/plugin-scaffolder-node-test-utils": "^0.3.3",
72
72
  "@types/libsodium-wrappers": "^0.7.10",
73
73
  "fs-extra": "^11.2.0",
74
74
  "jsonschema": "^1.2.6"