@backstage/plugin-scaffolder-backend-module-github 0.7.2-next.1 → 0.8.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/dist/actions/github.cjs.js +45 -52
  3. package/dist/actions/github.cjs.js.map +1 -1
  4. package/dist/actions/githubActionsDispatch.cjs.js +15 -29
  5. package/dist/actions/githubActionsDispatch.cjs.js.map +1 -1
  6. package/dist/actions/githubAutolinks.cjs.js +15 -30
  7. package/dist/actions/githubAutolinks.cjs.js.map +1 -1
  8. package/dist/actions/githubBranchProtection.cjs.js +15 -23
  9. package/dist/actions/githubBranchProtection.cjs.js.map +1 -1
  10. package/dist/actions/githubDeployKey.cjs.js +21 -41
  11. package/dist/actions/githubDeployKey.cjs.js.map +1 -1
  12. package/dist/actions/githubEnvironment.cjs.js +47 -89
  13. package/dist/actions/githubEnvironment.cjs.js.map +1 -1
  14. package/dist/actions/githubIssuesLabel.cjs.js +12 -27
  15. package/dist/actions/githubIssuesLabel.cjs.js.map +1 -1
  16. package/dist/actions/githubPagesEnable.cjs.js +15 -34
  17. package/dist/actions/githubPagesEnable.cjs.js.map +1 -1
  18. package/dist/actions/githubPullRequest.cjs.js +66 -126
  19. package/dist/actions/githubPullRequest.cjs.js.map +1 -1
  20. package/dist/actions/githubRepoCreate.cjs.js +35 -42
  21. package/dist/actions/githubRepoCreate.cjs.js.map +1 -1
  22. package/dist/actions/githubRepoPush.cjs.js +23 -30
  23. package/dist/actions/githubRepoPush.cjs.js.map +1 -1
  24. package/dist/actions/githubWebhook.cjs.js +29 -63
  25. package/dist/actions/githubWebhook.cjs.js.map +1 -1
  26. package/dist/actions/inputProperties.cjs.js +145 -281
  27. package/dist/actions/inputProperties.cjs.js.map +1 -1
  28. package/dist/actions/outputProperties.cjs.js +9 -12
  29. package/dist/actions/outputProperties.cjs.js.map +1 -1
  30. package/dist/index.d.ts +210 -211
  31. package/dist/module.cjs.js +4 -9
  32. package/dist/module.cjs.js.map +1 -1
  33. package/package.json +14 -13
package/dist/index.d.ts CHANGED
@@ -1,12 +1,10 @@
1
1
  import * as _backstage_plugin_scaffolder_node from '@backstage/plugin-scaffolder-node';
2
- import * as _backstage_types from '@backstage/types';
3
2
  import { ScmIntegrations, GithubCredentialsProvider, ScmIntegrationRegistry } from '@backstage/integration';
4
3
  import { Config } from '@backstage/config';
5
- import { CatalogApi } from '@backstage/catalog-client';
6
- import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
7
- import { AuthService } from '@backstage/backend-plugin-api';
4
+ import { CatalogService } from '@backstage/plugin-catalog-node';
8
5
  import { Octokit } from 'octokit';
9
6
  import { createPullRequest } from 'octokit-plugin-create-pull-request';
7
+ import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
10
8
  import { OctokitOptions } from '@octokit/core/dist-types/types';
11
9
 
12
10
  /**
@@ -20,11 +18,11 @@ declare function createGithubActionsDispatchAction(options: {
20
18
  repoUrl: string;
21
19
  workflowId: string;
22
20
  branchOrTagName: string;
23
- workflowInputs?: {
24
- [key: string]: string;
25
- };
26
- token?: string;
27
- }, _backstage_types.JsonObject, "v1">;
21
+ workflowInputs?: Record<string, string> | undefined;
22
+ token?: string | undefined;
23
+ }, {
24
+ [x: string]: any;
25
+ }, "v2">;
28
26
 
29
27
  /**
30
28
  * Adds labels to a pull request or issue on GitHub
@@ -37,8 +35,10 @@ declare function createGithubIssuesLabelAction(options: {
37
35
  repoUrl: string;
38
36
  number: number;
39
37
  labels: string[];
40
- token?: string;
41
- }, _backstage_types.JsonObject, "v1">;
38
+ token?: string | undefined;
39
+ }, {
40
+ [x: string]: any;
41
+ }, "v2">;
42
42
 
43
43
  /**
44
44
  * Creates a new action that initializes a git repository
@@ -50,68 +50,59 @@ declare function createGithubRepoCreateAction(options: {
50
50
  githubCredentialsProvider?: GithubCredentialsProvider;
51
51
  }): _backstage_plugin_scaffolder_node.TemplateAction<{
52
52
  repoUrl: string;
53
- description?: string;
54
- homepage?: string;
55
- access?: string;
56
- deleteBranchOnMerge?: boolean;
57
- gitAuthorName?: string;
58
- gitAuthorEmail?: string;
59
- allowRebaseMerge?: boolean;
60
- allowSquashMerge?: boolean;
61
- squashMergeCommitTitle?: "PR_TITLE" | "COMMIT_OR_PR_TITLE";
62
- squashMergeCommitMessage?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK";
63
- allowMergeCommit?: boolean;
64
- allowAutoMerge?: boolean;
65
- allowUpdateBranch?: boolean;
66
- requireCodeOwnerReviews?: boolean;
53
+ description?: string | undefined;
54
+ homepage?: string | undefined;
55
+ access?: string | undefined;
56
+ requireCodeOwnerReviews?: boolean | undefined;
67
57
  bypassPullRequestAllowances?: {
68
- users?: string[];
69
- teams?: string[];
70
- apps?: string[];
71
- };
72
- requiredApprovingReviewCount?: number;
58
+ apps?: string[] | undefined;
59
+ teams?: string[] | undefined;
60
+ users?: string[] | undefined;
61
+ } | undefined;
62
+ requiredApprovingReviewCount?: number | undefined;
73
63
  restrictions?: {
74
- users: string[];
75
64
  teams: string[];
76
- apps?: string[];
77
- };
78
- requiredStatusCheckContexts?: string[];
79
- requireBranchesToBeUpToDate?: boolean;
80
- requiredConversationResolution?: boolean;
81
- repoVisibility?: "private" | "internal" | "public";
82
- collaborators?: Array<{
65
+ users: string[];
66
+ apps?: string[] | undefined;
67
+ } | undefined;
68
+ requiredStatusCheckContexts?: string[] | undefined;
69
+ requireBranchesToBeUpToDate?: boolean | undefined;
70
+ requiredConversationResolution?: boolean | undefined;
71
+ repoVisibility?: "internal" | "private" | "public" | undefined;
72
+ deleteBranchOnMerge?: boolean | undefined;
73
+ allowMergeCommit?: boolean | undefined;
74
+ allowSquashMerge?: boolean | undefined;
75
+ squashMergeCommitTitle?: "PR_TITLE" | "COMMIT_OR_PR_TITLE" | undefined;
76
+ squashMergeCommitMessage?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK" | undefined;
77
+ allowRebaseMerge?: boolean | undefined;
78
+ allowAutoMerge?: boolean | undefined;
79
+ allowUpdateBranch?: boolean | undefined;
80
+ collaborators?: ({
83
81
  user: string;
84
82
  access: string;
85
83
  } | {
86
84
  team: string;
87
85
  access: string;
88
- } | {
89
- /** @deprecated This field is deprecated in favor of team */
90
- username: string;
91
- access: "pull" | "push" | "admin" | "maintain" | "triage";
92
- }>;
93
- hasProjects?: boolean;
94
- hasWiki?: boolean;
95
- hasIssues?: boolean;
96
- token?: string;
97
- topics?: string[];
98
- repoVariables?: {
99
- [key: string]: string;
100
- };
101
- secrets?: {
102
- [key: string]: string;
103
- };
86
+ })[] | undefined;
87
+ hasProjects?: boolean | undefined;
88
+ hasWiki?: boolean | undefined;
89
+ hasIssues?: boolean | undefined;
90
+ token?: string | undefined;
91
+ topics?: string[] | undefined;
92
+ repoVariables?: Record<string, string> | undefined;
93
+ secrets?: Record<string, string> | undefined;
104
94
  oidcCustomization?: {
105
95
  useDefault: boolean;
106
- includeClaimKeys?: string[];
107
- };
108
- requireCommitSigning?: boolean;
109
- requiredLinearHistory?: boolean;
110
- customProperties?: {
111
- [key: string]: string;
112
- };
113
- subscribe?: boolean;
114
- }, _backstage_types.JsonObject, "v1">;
96
+ includeClaimKeys?: string[] | undefined;
97
+ } | undefined;
98
+ requiredCommitSigning?: boolean | undefined;
99
+ requiredLinearHistory?: boolean | undefined;
100
+ customProperties?: Record<string, string> | undefined;
101
+ subscribe?: boolean | undefined;
102
+ }, {
103
+ remoteUrl: string;
104
+ repoContentsUrl: string;
105
+ }, "v2">;
115
106
 
116
107
  /**
117
108
  * Creates a new action that initializes a git repository of the content in the workspace
@@ -125,35 +116,38 @@ declare function createGithubRepoPushAction(options: {
125
116
  githubCredentialsProvider?: GithubCredentialsProvider;
126
117
  }): _backstage_plugin_scaffolder_node.TemplateAction<{
127
118
  repoUrl: string;
128
- description?: string;
129
- defaultBranch?: string;
130
- protectDefaultBranch?: boolean;
131
- protectEnforceAdmins?: boolean;
132
- gitCommitMessage?: string;
133
- gitAuthorName?: string;
134
- gitAuthorEmail?: string;
135
- requireCodeOwnerReviews?: boolean;
136
- dismissStaleReviews?: boolean;
119
+ requireCodeOwnerReviews?: boolean | undefined;
120
+ dismissStaleReviews?: boolean | undefined;
121
+ requiredStatusCheckContexts?: string[] | undefined;
137
122
  bypassPullRequestAllowances?: {
138
- users?: string[];
139
- teams?: string[];
140
- apps?: string[];
123
+ apps?: string[] | undefined;
124
+ teams?: string[] | undefined;
125
+ users?: string[] | undefined;
141
126
  } | undefined;
142
- requiredApprovingReviewCount?: number;
127
+ requiredApprovingReviewCount?: number | undefined;
143
128
  restrictions?: {
144
- users: string[];
145
129
  teams: string[];
146
- apps?: string[];
130
+ users: string[];
131
+ apps?: string[] | undefined;
147
132
  } | undefined;
148
- requiredStatusCheckContexts?: string[];
149
- requireBranchesToBeUpToDate?: boolean;
150
- requiredConversationResolution?: boolean;
151
- sourcePath?: string;
152
- token?: string;
153
- requiredCommitSigning?: boolean;
154
- requiredLinearHistory?: boolean;
155
- requireLastPushApproval?: boolean;
156
- }, _backstage_types.JsonObject, "v1">;
133
+ requireBranchesToBeUpToDate?: boolean | undefined;
134
+ requiredConversationResolution?: boolean | undefined;
135
+ requireLastPushApproval?: boolean | undefined;
136
+ defaultBranch?: string | undefined;
137
+ protectDefaultBranch?: boolean | undefined;
138
+ protectEnforceAdmins?: boolean | undefined;
139
+ gitCommitMessage?: string | undefined;
140
+ gitAuthorName?: string | undefined;
141
+ gitAuthorEmail?: string | undefined;
142
+ sourcePath?: string | undefined;
143
+ token?: string | undefined;
144
+ requiredCommitSigning?: boolean | undefined;
145
+ requiredLinearHistory?: boolean | undefined;
146
+ }, {
147
+ remoteUrl: string;
148
+ repoContentsUrl: string;
149
+ commitHash: string;
150
+ }, "v2">;
157
151
 
158
152
  /**
159
153
  * Creates new action that creates a webhook for a repository on GitHub.
@@ -166,13 +160,15 @@ declare function createGithubWebhookAction(options: {
166
160
  }): _backstage_plugin_scaffolder_node.TemplateAction<{
167
161
  repoUrl: string;
168
162
  webhookUrl: string;
169
- webhookSecret?: string;
170
- events?: string[];
171
- active?: boolean;
172
- contentType?: "form" | "json";
173
- insecureSsl?: boolean;
174
- token?: string;
175
- }, _backstage_types.JsonObject, "v1">;
163
+ webhookSecret?: string | undefined;
164
+ events?: string[] | "*"[] | undefined;
165
+ active?: boolean | undefined;
166
+ contentType?: "form" | "json" | undefined;
167
+ insecureSsl?: boolean | undefined;
168
+ token?: string | undefined;
169
+ }, {
170
+ [x: string]: any;
171
+ }, "v2">;
176
172
 
177
173
  /**
178
174
  * Creates an `github:deployKey:create` Scaffolder action that creates a Deploy Key
@@ -186,9 +182,11 @@ declare function createGithubDeployKeyAction(options: {
186
182
  publicKey: string;
187
183
  privateKey: string;
188
184
  deployKeyName: string;
189
- privateKeySecretName?: string;
190
- token?: string;
191
- }, _backstage_types.JsonObject, "v1">;
185
+ privateKeySecretName?: string | undefined;
186
+ token?: string | undefined;
187
+ }, {
188
+ privateKeySecretName: string;
189
+ }, "v2">;
192
190
 
193
191
  /**
194
192
  * Creates an `github:environment:create` Scaffolder action that creates a Github Environment.
@@ -197,28 +195,25 @@ declare function createGithubDeployKeyAction(options: {
197
195
  */
198
196
  declare function createGithubEnvironmentAction(options: {
199
197
  integrations: ScmIntegrationRegistry;
200
- catalogClient?: CatalogApi;
201
- auth?: AuthService;
198
+ catalog: CatalogService;
202
199
  }): _backstage_plugin_scaffolder_node.TemplateAction<{
203
200
  repoUrl: string;
204
201
  name: string;
205
202
  deploymentBranchPolicy?: {
206
203
  protected_branches: boolean;
207
204
  custom_branch_policies: boolean;
208
- };
209
- customBranchPolicyNames?: string[];
210
- customTagPolicyNames?: string[];
211
- environmentVariables?: {
212
- [key: string]: string;
213
- };
214
- secrets?: {
215
- [key: string]: string;
216
- };
217
- token?: string;
218
- waitTimer?: number;
219
- preventSelfReview?: boolean;
220
- reviewers?: string[];
221
- }, _backstage_types.JsonObject, "v1">;
205
+ } | undefined;
206
+ customBranchPolicyNames?: string[] | undefined;
207
+ customTagPolicyNames?: string[] | undefined;
208
+ environmentVariables?: Record<string, string> | undefined;
209
+ secrets?: Record<string, string> | undefined;
210
+ token?: string | undefined;
211
+ waitTimer?: number | undefined;
212
+ preventSelfReview?: boolean | undefined;
213
+ reviewers?: string[] | undefined;
214
+ }, {
215
+ [x: string]: any;
216
+ }, "v2">;
222
217
 
223
218
  /**
224
219
  * The options passed to {@link createPublishGithubPullRequestAction} method
@@ -264,26 +259,30 @@ interface CreateGithubPullRequestActionOptions {
264
259
  * @public
265
260
  */
266
261
  declare const createPublishGithubPullRequestAction: (options: CreateGithubPullRequestActionOptions) => _backstage_plugin_scaffolder_node.TemplateAction<{
267
- title: string;
262
+ repoUrl: string;
268
263
  branchName: string;
269
- targetBranchName?: string;
264
+ title: string;
270
265
  description: string;
271
- repoUrl: string;
272
- draft?: boolean;
273
- targetPath?: string;
274
- sourcePath?: string;
275
- token?: string;
276
- reviewers?: string[];
277
- assignees?: string[];
278
- teamReviewers?: string[];
279
- commitMessage?: string;
280
- update?: boolean;
281
- forceFork?: boolean;
282
- gitAuthorName?: string;
283
- gitAuthorEmail?: string;
284
- forceEmptyGitAuthor?: boolean;
285
- createWhenEmpty?: boolean;
286
- }, _backstage_types.JsonObject, "v1">;
266
+ targetBranchName?: string | undefined;
267
+ draft?: boolean | undefined;
268
+ sourcePath?: string | undefined;
269
+ targetPath?: string | undefined;
270
+ token?: string | undefined;
271
+ reviewers?: string[] | undefined;
272
+ assignees?: string[] | undefined;
273
+ teamReviewers?: string[] | undefined;
274
+ commitMessage?: string | undefined;
275
+ update?: boolean | undefined;
276
+ forceFork?: boolean | undefined;
277
+ gitAuthorName?: string | undefined;
278
+ gitAuthorEmail?: string | undefined;
279
+ forceEmptyGitAuthor?: boolean | undefined;
280
+ createWhenEmpty?: boolean | undefined;
281
+ }, {
282
+ targetBranchName: string;
283
+ remoteUrl: string;
284
+ pullRequestNumber: number;
285
+ }, "v2">;
287
286
 
288
287
  /**
289
288
  * Creates a new action that initializes a git repository of the content in the workspace
@@ -297,75 +296,69 @@ declare function createPublishGithubAction(options: {
297
296
  githubCredentialsProvider?: GithubCredentialsProvider;
298
297
  }): _backstage_plugin_scaffolder_node.TemplateAction<{
299
298
  repoUrl: string;
300
- description?: string;
301
- homepage?: string;
302
- access?: string;
303
- defaultBranch?: string;
304
- protectDefaultBranch?: boolean;
305
- protectEnforceAdmins?: boolean;
306
- deleteBranchOnMerge?: boolean;
307
- gitCommitMessage?: string;
308
- gitAuthorName?: string;
309
- gitAuthorEmail?: string;
310
- allowRebaseMerge?: boolean;
311
- allowSquashMerge?: boolean;
312
- squashMergeCommitTitle?: "PR_TITLE" | "COMMIT_OR_PR_TITLE";
313
- squashMergeCommitMessage?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK";
314
- allowMergeCommit?: boolean;
315
- allowAutoMerge?: boolean;
316
- allowUpdateBranch?: boolean;
317
- sourcePath?: string;
299
+ description?: string | undefined;
300
+ homepage?: string | undefined;
301
+ access?: string | undefined;
318
302
  bypassPullRequestAllowances?: {
319
- users?: string[];
320
- teams?: string[];
321
- apps?: string[];
303
+ apps?: string[] | undefined;
304
+ teams?: string[] | undefined;
305
+ users?: string[] | undefined;
322
306
  } | undefined;
323
- requiredApprovingReviewCount?: number;
307
+ requiredApprovingReviewCount?: number | undefined;
324
308
  restrictions?: {
325
- users: string[];
326
309
  teams: string[];
327
- apps?: string[];
310
+ users: string[];
311
+ apps?: string[] | undefined;
328
312
  } | undefined;
329
- requireCodeOwnerReviews?: boolean;
330
- dismissStaleReviews?: boolean;
331
- requiredStatusCheckContexts?: string[];
332
- requireBranchesToBeUpToDate?: boolean;
333
- requiredConversationResolution?: boolean;
334
- requireLastPushApproval?: boolean;
335
- repoVisibility?: "private" | "internal" | "public";
336
- collaborators?: Array<{
313
+ requireCodeOwnerReviews?: boolean | undefined;
314
+ dismissStaleReviews?: boolean | undefined;
315
+ requiredStatusCheckContexts?: string[] | undefined;
316
+ requireBranchesToBeUpToDate?: boolean | undefined;
317
+ requiredConversationResolution?: boolean | undefined;
318
+ requireLastPushApproval?: boolean | undefined;
319
+ repoVisibility?: "internal" | "private" | "public" | undefined;
320
+ defaultBranch?: string | undefined;
321
+ protectDefaultBranch?: boolean | undefined;
322
+ protectEnforceAdmins?: boolean | undefined;
323
+ deleteBranchOnMerge?: boolean | undefined;
324
+ gitCommitMessage?: string | undefined;
325
+ gitAuthorName?: string | undefined;
326
+ gitAuthorEmail?: string | undefined;
327
+ allowMergeCommit?: boolean | undefined;
328
+ allowSquashMerge?: boolean | undefined;
329
+ squashMergeCommitTitle?: "PR_TITLE" | "COMMIT_OR_PR_TITLE" | undefined;
330
+ squashMergeCommitMessage?: "PR_BODY" | "COMMIT_MESSAGES" | "BLANK" | undefined;
331
+ allowRebaseMerge?: boolean | undefined;
332
+ allowAutoMerge?: boolean | undefined;
333
+ allowUpdateBranch?: boolean | undefined;
334
+ sourcePath?: string | undefined;
335
+ collaborators?: ({
337
336
  user: string;
338
337
  access: string;
339
338
  } | {
340
339
  team: string;
341
340
  access: string;
342
- } | {
343
- /** @deprecated This field is deprecated in favor of team */
344
- username: string;
345
- access: "pull" | "push" | "admin" | "maintain" | "triage";
346
- }>;
341
+ })[] | undefined;
347
342
  hasProjects?: boolean | undefined;
348
343
  hasWiki?: boolean | undefined;
349
344
  hasIssues?: boolean | undefined;
350
- token?: string;
351
- topics?: string[];
352
- repoVariables?: {
353
- [key: string]: string;
354
- };
355
- secrets?: {
356
- [key: string]: string;
357
- };
345
+ token?: string | undefined;
346
+ topics?: string[] | undefined;
347
+ repoVariables?: Record<string, string> | undefined;
348
+ secrets?: Record<string, string> | undefined;
358
349
  oidcCustomization?: {
359
350
  useDefault: boolean;
360
- includeClaimKeys?: string[];
361
- };
362
- requiredCommitSigning?: boolean;
363
- requiredLinearHistory?: boolean;
364
- customProperties?: {
365
- [key: string]: string;
366
- };
367
- subscribe?: boolean;
368
- }, _backstage_types.JsonObject, "v1">;
351
+ includeClaimKeys?: string[] | undefined;
352
+ } | undefined;
353
+ requiredCommitSigning?: boolean | undefined;
354
+ requiredLinearHistory?: boolean | undefined;
355
+ customProperties?: Record<string, string> | undefined;
356
+ subscribe?: boolean | undefined;
357
+ }, {
358
+ remoteUrl: string;
359
+ repoContentsUrl: string;
360
+ commitHash: string;
361
+ }, "v2">;
369
362
 
370
363
  /**
371
364
  * Create an autolink reference for a repository
@@ -378,9 +371,11 @@ declare function createGithubAutolinksAction(options: {
378
371
  repoUrl: string;
379
372
  keyPrefix: string;
380
373
  urlTemplate: string;
381
- isAlphanumeric?: boolean;
382
- token?: string;
383
- }, _backstage_types.JsonObject, "v1">;
374
+ isAlphanumeric?: boolean | undefined;
375
+ token?: string | undefined;
376
+ }, {
377
+ [x: string]: any;
378
+ }, "v2">;
384
379
 
385
380
  /**
386
381
  * Creates a new action that enables GitHub Pages for a repository.
@@ -392,11 +387,13 @@ declare function createGithubPagesEnableAction(options: {
392
387
  githubCredentialsProvider?: GithubCredentialsProvider;
393
388
  }): _backstage_plugin_scaffolder_node.TemplateAction<{
394
389
  repoUrl: string;
395
- buildType?: "legacy" | "workflow";
396
- sourceBranch?: string;
397
- sourcePath?: "/" | "/docs";
398
- token?: string;
399
- }, _backstage_types.JsonObject, "v1">;
390
+ buildType?: "legacy" | "workflow" | undefined;
391
+ sourceBranch?: string | undefined;
392
+ sourcePath?: "/" | "/docs" | undefined;
393
+ token?: string | undefined;
394
+ }, {
395
+ [x: string]: any;
396
+ }, "v2">;
400
397
 
401
398
  /**
402
399
  * Creates an `github:branch-protection:create` Scaffolder action that configured Branch Protection in a Github Repository.
@@ -407,29 +404,31 @@ declare function createGithubBranchProtectionAction(options: {
407
404
  integrations: ScmIntegrationRegistry;
408
405
  }): _backstage_plugin_scaffolder_node.TemplateAction<{
409
406
  repoUrl: string;
410
- branch?: string;
411
- enforceAdmins?: boolean;
412
- requiredApprovingReviewCount?: number;
413
- requireCodeOwnerReviews?: boolean;
414
- dismissStaleReviews?: boolean;
407
+ branch?: string | undefined;
408
+ enforceAdmins?: boolean | undefined;
409
+ requiredApprovingReviewCount?: number | undefined;
410
+ requireCodeOwnerReviews?: boolean | undefined;
411
+ dismissStaleReviews?: boolean | undefined;
415
412
  bypassPullRequestAllowances?: {
416
- users?: string[];
417
- teams?: string[];
418
- apps?: string[];
413
+ apps?: string[] | undefined;
414
+ teams?: string[] | undefined;
415
+ users?: string[] | undefined;
419
416
  } | undefined;
420
417
  restrictions?: {
421
- users: string[];
422
418
  teams: string[];
423
- apps?: string[];
419
+ users: string[];
420
+ apps?: string[] | undefined;
424
421
  } | undefined;
425
- requiredStatusCheckContexts?: string[];
426
- requireBranchesToBeUpToDate?: boolean;
427
- requiredConversationResolution?: boolean;
428
- requireLastPushApproval?: boolean;
429
- requiredCommitSigning?: boolean;
430
- requiredLinearHistory?: boolean;
431
- token?: string;
432
- }, _backstage_types.JsonObject, "v1">;
422
+ requiredStatusCheckContexts?: string[] | undefined;
423
+ requireBranchesToBeUpToDate?: boolean | undefined;
424
+ requiredConversationResolution?: boolean | undefined;
425
+ requireLastPushApproval?: boolean | undefined;
426
+ requiredCommitSigning?: boolean | undefined;
427
+ requiredLinearHistory?: boolean | undefined;
428
+ token?: string | undefined;
429
+ }, {
430
+ [x: string]: any;
431
+ }, "v2">;
433
432
 
434
433
  /**
435
434
  * @public
@@ -15,8 +15,8 @@ var githubAutolinks = require('./actions/githubAutolinks.cjs.js');
15
15
  var githubPagesEnable = require('./actions/githubPagesEnable.cjs.js');
16
16
  var githubBranchProtection = require('./actions/githubBranchProtection.cjs.js');
17
17
  var integration = require('@backstage/integration');
18
- var catalogClient = require('@backstage/catalog-client');
19
18
  var autocomplete = require('./autocomplete/autocomplete.cjs.js');
19
+ var pluginCatalogNode = require('@backstage/plugin-catalog-node');
20
20
 
21
21
  const githubModule = backendPluginApi.createBackendModule({
22
22
  pluginId: "scaffolder",
@@ -26,16 +26,12 @@ const githubModule = backendPluginApi.createBackendModule({
26
26
  deps: {
27
27
  scaffolder: alpha.scaffolderActionsExtensionPoint,
28
28
  config: backendPluginApi.coreServices.rootConfig,
29
- discovery: backendPluginApi.coreServices.discovery,
30
- auth: backendPluginApi.coreServices.auth,
29
+ catalog: pluginCatalogNode.catalogServiceRef,
31
30
  autocomplete: alpha.scaffolderAutocompleteExtensionPoint
32
31
  },
33
- async init({ scaffolder, config, discovery, auth, autocomplete: autocomplete$1 }) {
32
+ async init({ scaffolder, config, autocomplete: autocomplete$1, catalog }) {
34
33
  const integrations = integration.ScmIntegrations.fromConfig(config);
35
34
  const githubCredentialsProvider = integration.DefaultGithubCredentialsProvider.fromIntegrations(integrations);
36
- const catalogClient$1 = new catalogClient.CatalogClient({
37
- discoveryApi: discovery
38
- });
39
35
  scaffolder.addActions(
40
36
  githubActionsDispatch.createGithubActionsDispatchAction({
41
37
  integrations,
@@ -50,8 +46,7 @@ const githubModule = backendPluginApi.createBackendModule({
50
46
  }),
51
47
  githubEnvironment.createGithubEnvironmentAction({
52
48
  integrations,
53
- catalogClient: catalogClient$1,
54
- auth
49
+ catalog
55
50
  }),
56
51
  githubIssuesLabel.createGithubIssuesLabelAction({
57
52
  integrations,
@@ -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 { CatalogClient } from '@backstage/catalog-client';\nimport { createHandleAutocompleteRequest } from './autocomplete/autocomplete';\n\n/**\n * @public\n * The GitHub Module for the Scaffolder Backend\n */\nexport const githubModule = createBackendModule({\n pluginId: 'scaffolder',\n moduleId: 'github',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n config: coreServices.rootConfig,\n discovery: coreServices.discovery,\n auth: coreServices.auth,\n autocomplete: scaffolderAutocompleteExtensionPoint,\n },\n async init({ scaffolder, config, discovery, auth, autocomplete }) {\n const integrations = ScmIntegrations.fromConfig(config);\n const githubCredentialsProvider =\n DefaultGithubCredentialsProvider.fromIntegrations(integrations);\n const catalogClient = new CatalogClient({\n discoveryApi: discovery,\n });\n\n scaffolder.addActions(\n createGithubActionsDispatchAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubAutolinksAction({\n integrations,\n githubCredentialsProvider,\n }),\n createGithubDeployKeyAction({\n integrations,\n }),\n createGithubEnvironmentAction({\n integrations,\n catalogClient,\n auth,\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","scaffolderAutocompleteExtensionPoint","autocomplete","ScmIntegrations","DefaultGithubCredentialsProvider","catalogClient","CatalogClient","createGithubActionsDispatchAction","createGithubAutolinksAction","createGithubDeployKeyAction","createGithubEnvironmentAction","createGithubIssuesLabelAction","createGithubRepoCreateAction","createGithubRepoPushAction","createGithubWebhookAction","createPublishGithubAction","createPublishGithubPullRequestAction","createGithubPagesEnableAction","createGithubBranchProtectionAction","createHandleAutocompleteRequest"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgDO,MAAM,eAAeA,oCAAoB,CAAA;AAAA,EAC9C,QAAU,EAAA,YAAA;AAAA,EACV,QAAU,EAAA,QAAA;AAAA,EACV,QAAA,CAAS,EAAE,YAAA,EAAgB,EAAA;AACzB,IAAa,YAAA,CAAA;AAAA,MACX,IAAM,EAAA;AAAA,QACJ,UAAY,EAAAC,qCAAA;AAAA,QACZ,QAAQC,6BAAa,CAAA,UAAA;AAAA,QACrB,WAAWA,6BAAa,CAAA,SAAA;AAAA,QACxB,MAAMA,6BAAa,CAAA,IAAA;AAAA,QACnB,YAAc,EAAAC;AAAA,OAChB;AAAA,MACA,MAAM,KAAK,EAAE,UAAA,EAAY,QAAQ,SAAW,EAAA,IAAA,gBAAMC,gBAAgB,EAAA;AAChE,QAAM,MAAA,YAAA,GAAeC,2BAAgB,CAAA,UAAA,CAAW,MAAM,CAAA;AACtD,QAAM,MAAA,yBAAA,GACJC,4CAAiC,CAAA,gBAAA,CAAiB,YAAY,CAAA;AAChE,QAAM,MAAAC,eAAA,GAAgB,IAAIC,2BAAc,CAAA;AAAA,UACtC,YAAc,EAAA;AAAA,SACf,CAAA;AAED,QAAW,UAAA,CAAA,UAAA;AAAA,UACTC,uDAAkC,CAAA;AAAA,YAChC,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,2CAA4B,CAAA;AAAA,YAC1B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,2CAA4B,CAAA;AAAA,YAC1B;AAAA,WACD,CAAA;AAAA,UACDC,+CAA8B,CAAA;AAAA,YAC5B,YAAA;AAAA,2BACAL,eAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDM,+CAA8B,CAAA;AAAA,YAC5B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,6CAA6B,CAAA;AAAA,YAC3B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,yCAA2B,CAAA,EAAE,YAAc,EAAA,MAAA,EAAQ,CAAA;AAAA,UACnDC,uCAA0B,CAAA;AAAA,YACxB,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,gCAA0B,CAAA;AAAA,YACxB,YAAA;AAAA,YACA,MAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,sDAAqC,CAAA;AAAA,YACnC,YAAA;AAAA,YACA,yBAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,+CAA8B,CAAA;AAAA,YAC5B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,yDAAmC,CAAA;AAAA,YACjC;AAAA,WACD;AAAA,SACH;AAEA,QAAAhB,cAAA,CAAa,uBAAwB,CAAA;AAAA,UACnC,EAAI,EAAA,QAAA;AAAA,UACJ,OAAS,EAAAiB,4CAAA,CAAgC,EAAE,YAAA,EAAc;AAAA,SAC1D,CAAA;AAAA;AACH,KACD,CAAA;AAAA;AAEL,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 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,eAAeA,oCAAoB,CAAA;AAAA,EAC9C,QAAU,EAAA,YAAA;AAAA,EACV,QAAU,EAAA,QAAA;AAAA,EACV,QAAA,CAAS,EAAE,YAAA,EAAgB,EAAA;AACzB,IAAa,YAAA,CAAA;AAAA,MACX,IAAM,EAAA;AAAA,QACJ,UAAY,EAAAC,qCAAA;AAAA,QACZ,QAAQC,6BAAa,CAAA,UAAA;AAAA,QACrB,OAAS,EAAAC,mCAAA;AAAA,QACT,YAAc,EAAAC;AAAA,OAChB;AAAA,MACA,MAAM,IAAK,CAAA,EAAE,YAAY,MAAQ,gBAAAC,cAAA,EAAc,SAAW,EAAA;AACxD,QAAM,MAAA,YAAA,GAAeC,2BAAgB,CAAA,UAAA,CAAW,MAAM,CAAA;AACtD,QAAM,MAAA,yBAAA,GACJC,4CAAiC,CAAA,gBAAA,CAAiB,YAAY,CAAA;AAEhE,QAAW,UAAA,CAAA,UAAA;AAAA,UACTC,uDAAkC,CAAA;AAAA,YAChC,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,2CAA4B,CAAA;AAAA,YAC1B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,2CAA4B,CAAA;AAAA,YAC1B;AAAA,WACD,CAAA;AAAA,UACDC,+CAA8B,CAAA;AAAA,YAC5B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,+CAA8B,CAAA;AAAA,YAC5B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,6CAA6B,CAAA;AAAA,YAC3B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,yCAA2B,CAAA,EAAE,YAAc,EAAA,MAAA,EAAQ,CAAA;AAAA,UACnDC,uCAA0B,CAAA;AAAA,YACxB,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,gCAA0B,CAAA;AAAA,YACxB,YAAA;AAAA,YACA,MAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,sDAAqC,CAAA;AAAA,YACnC,YAAA;AAAA,YACA,yBAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,+CAA8B,CAAA;AAAA,YAC5B,YAAA;AAAA,YACA;AAAA,WACD,CAAA;AAAA,UACDC,yDAAmC,CAAA;AAAA,YACjC;AAAA,WACD;AAAA,SACH;AAEA,QAAAd,cAAA,CAAa,uBAAwB,CAAA;AAAA,UACnC,EAAI,EAAA,QAAA;AAAA,UACJ,OAAS,EAAAe,4CAAA,CAAgC,EAAE,YAAA,EAAc;AAAA,SAC1D,CAAA;AAAA;AACH,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}