@backstage/plugin-scaffolder-backend 1.18.0 → 1.19.0-next.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.
@@ -80,7 +80,7 @@ var winston__namespace = /*#__PURE__*/_interopNamespace(winston);
80
80
  var nunjucks__default = /*#__PURE__*/_interopDefaultLegacy(nunjucks);
81
81
  var os__default = /*#__PURE__*/_interopDefaultLegacy(os);
82
82
 
83
- const examples$h = [
83
+ const examples$k = [
84
84
  {
85
85
  description: "Register with the catalog",
86
86
  example: yaml__default["default"].stringify({
@@ -104,7 +104,7 @@ function createCatalogRegisterAction(options) {
104
104
  return pluginScaffolderNode.createTemplateAction({
105
105
  id: id$4,
106
106
  description: "Registers entities from a catalog descriptor file in the workspace into the software catalog.",
107
- examples: examples$h,
107
+ examples: examples$k,
108
108
  schema: {
109
109
  input: {
110
110
  oneOf: [
@@ -228,7 +228,7 @@ function createCatalogRegisterAction(options) {
228
228
  });
229
229
  }
230
230
 
231
- const examples$g = [
231
+ const examples$j = [
232
232
  {
233
233
  description: "Write a catalog yaml file",
234
234
  example: yaml__namespace.stringify({
@@ -272,7 +272,7 @@ function createCatalogWriteAction() {
272
272
  )
273
273
  })
274
274
  },
275
- examples: examples$g,
275
+ examples: examples$j,
276
276
  supportsDryRun: true,
277
277
  async handler(ctx) {
278
278
  ctx.logStream.write(`Writing catalog-info.yaml`);
@@ -286,7 +286,7 @@ function createCatalogWriteAction() {
286
286
  });
287
287
  }
288
288
 
289
- const examples$f = [
289
+ const examples$i = [
290
290
  {
291
291
  description: "Fetch entity by reference",
292
292
  example: yaml__default["default"].stringify({
@@ -325,7 +325,7 @@ function createFetchCatalogEntityAction(options) {
325
325
  return pluginScaffolderNode.createTemplateAction({
326
326
  id: id$2,
327
327
  description: "Returns entity or entities from the catalog by entity reference(s)",
328
- examples: examples$f,
328
+ examples: examples$i,
329
329
  supportsDryRun: true,
330
330
  schema: {
331
331
  input: zod.z.object({
@@ -400,7 +400,7 @@ function createFetchCatalogEntityAction(options) {
400
400
  });
401
401
  }
402
402
 
403
- const examples$e = [
403
+ const examples$h = [
404
404
  {
405
405
  description: "Write a debug message",
406
406
  example: yaml__default["default"].stringify({
@@ -438,7 +438,7 @@ function createDebugLogAction() {
438
438
  return pluginScaffolderNode.createTemplateAction({
439
439
  id: id$1,
440
440
  description: "Writes a message into the log or lists all files in the workspace.",
441
- examples: examples$e,
441
+ examples: examples$h,
442
442
  schema: {
443
443
  input: {
444
444
  type: "object",
@@ -485,7 +485,7 @@ async function recursiveReadDir(dir) {
485
485
  return files.reduce((a, f) => a.concat(f), []);
486
486
  }
487
487
 
488
- const examples$d = [
488
+ const examples$g = [
489
489
  {
490
490
  description: "Waiting for 50 milliseconds",
491
491
  example: yaml__default["default"].stringify({
@@ -548,7 +548,7 @@ function createWaitAction(options) {
548
548
  return pluginScaffolderNode.createTemplateAction({
549
549
  id,
550
550
  description: "Waits for a certain period of time.",
551
- examples: examples$d,
551
+ examples: examples$g,
552
552
  schema: {
553
553
  input: {
554
554
  type: "object",
@@ -593,7 +593,7 @@ function createWaitAction(options) {
593
593
  });
594
594
  }
595
595
 
596
- const examples$c = [
596
+ const examples$f = [
597
597
  {
598
598
  description: "Downloads content and places it in the workspace.",
599
599
  example: yaml__default["default"].stringify({
@@ -632,7 +632,7 @@ function createFetchPlainAction(options) {
632
632
  const { reader, integrations } = options;
633
633
  return pluginScaffolderNode.createTemplateAction({
634
634
  id: ACTION_ID,
635
- examples: examples$c,
635
+ examples: examples$f,
636
636
  description: "Downloads content and places it in the workspace, or optionally in a subdirectory specified by the `targetPath` input option.",
637
637
  schema: {
638
638
  input: {
@@ -669,7 +669,7 @@ function createFetchPlainAction(options) {
669
669
  });
670
670
  }
671
671
 
672
- const examples$b = [
672
+ const examples$e = [
673
673
  {
674
674
  description: "Downloads a file and places it in the workspace.",
675
675
  example: yaml__default["default"].stringify({
@@ -693,7 +693,7 @@ function createFetchPlainFileAction(options) {
693
693
  return pluginScaffolderNode.createTemplateAction({
694
694
  id: "fetch:plain:file",
695
695
  description: "Downloads single file and places it in the workspace.",
696
- examples: examples$b,
696
+ examples: examples$e,
697
697
  schema: {
698
698
  input: {
699
699
  type: "object",
@@ -961,7 +961,7 @@ const createDefaultFilters = ({
961
961
  };
962
962
  };
963
963
 
964
- const examples$a = [
964
+ const examples$d = [
965
965
  {
966
966
  description: "Downloads a skelaton directory that lives alongside the template file and fill it out with values.",
967
967
  example: yaml__default["default"].stringify({
@@ -997,7 +997,7 @@ function createFetchTemplateAction(options) {
997
997
  return pluginScaffolderNode.createTemplateAction({
998
998
  id: "fetch:template",
999
999
  description: "Downloads a skeleton, templates variables into file and directory names and content, and places the result in the workspace, or optionally in a subdirectory specified by the `targetPath` input option.",
1000
- examples: examples$a,
1000
+ examples: examples$d,
1001
1001
  schema: {
1002
1002
  input: {
1003
1003
  type: "object",
@@ -1202,7 +1202,7 @@ function containsSkippedContent(localOutputPath) {
1202
1202
  return localOutputPath === "" || localOutputPath.startsWith("/") || localOutputPath.includes("//");
1203
1203
  }
1204
1204
 
1205
- const examples$9 = [
1205
+ const examples$c = [
1206
1206
  {
1207
1207
  description: "Delete specified files",
1208
1208
  example: yaml__namespace.stringify({
@@ -1224,7 +1224,7 @@ const createFilesystemDeleteAction = () => {
1224
1224
  return pluginScaffolderNode.createTemplateAction({
1225
1225
  id: "fs:delete",
1226
1226
  description: "Deletes files and directories from the workspace",
1227
- examples: examples$9,
1227
+ examples: examples$c,
1228
1228
  schema: {
1229
1229
  input: {
1230
1230
  required: ["files"],
@@ -1261,7 +1261,7 @@ const createFilesystemDeleteAction = () => {
1261
1261
  });
1262
1262
  };
1263
1263
 
1264
- const examples$8 = [
1264
+ const examples$b = [
1265
1265
  {
1266
1266
  description: "Rename specified files ",
1267
1267
  example: yaml__namespace.stringify({
@@ -1287,7 +1287,7 @@ const createFilesystemRenameAction = () => {
1287
1287
  return pluginScaffolderNode.createTemplateAction({
1288
1288
  id: "fs:rename",
1289
1289
  description: "Renames files and directories within the workspace",
1290
- examples: examples$8,
1290
+ examples: examples$b,
1291
1291
  schema: {
1292
1292
  input: {
1293
1293
  required: ["files"],
@@ -1769,7 +1769,7 @@ async function validateAccessTeam(client, access) {
1769
1769
  }
1770
1770
  }
1771
1771
 
1772
- const examples$7 = [
1772
+ const examples$a = [
1773
1773
  {
1774
1774
  description: "GitHub Action Workflow Without Inputs.",
1775
1775
  example: yaml__default["default"].stringify({
@@ -1830,7 +1830,7 @@ function createGithubActionsDispatchAction(options) {
1830
1830
  return pluginScaffolderNode.createTemplateAction({
1831
1831
  id: "github:actions:dispatch",
1832
1832
  description: "Dispatches a GitHub Action workflow for a given branch or tag",
1833
- examples: examples$7,
1833
+ examples: examples$a,
1834
1834
  schema: {
1835
1835
  input: {
1836
1836
  type: "object",
@@ -1899,7 +1899,7 @@ function createGithubActionsDispatchAction(options) {
1899
1899
  });
1900
1900
  }
1901
1901
 
1902
- const examples$6 = [
1902
+ const examples$9 = [
1903
1903
  {
1904
1904
  description: "Add labels to pull request or issue",
1905
1905
  example: yaml__default["default"].stringify({
@@ -1940,7 +1940,7 @@ function createGithubIssuesLabelAction(options) {
1940
1940
  return pluginScaffolderNode.createTemplateAction({
1941
1941
  id: "github:issues:label",
1942
1942
  description: "Adds labels to a pull request or issue on GitHub.",
1943
- examples: examples$6,
1943
+ examples: examples$9,
1944
1944
  schema: {
1945
1945
  input: {
1946
1946
  type: "object",
@@ -2263,7 +2263,7 @@ const commitHash = {
2263
2263
  type: "string"
2264
2264
  };
2265
2265
 
2266
- const examples$5 = [
2266
+ const examples$8 = [
2267
2267
  {
2268
2268
  description: "Creates a GitHub repository with default configuration.",
2269
2269
  example: yaml__default["default"].stringify({
@@ -2316,7 +2316,7 @@ function createGithubRepoCreateAction(options) {
2316
2316
  return pluginScaffolderNode.createTemplateAction({
2317
2317
  id: "github:repo:create",
2318
2318
  description: "Creates a GitHub repository.",
2319
- examples: examples$5,
2319
+ examples: examples$8,
2320
2320
  schema: {
2321
2321
  input: {
2322
2322
  type: "object",
@@ -2423,7 +2423,7 @@ function createGithubRepoCreateAction(options) {
2423
2423
  });
2424
2424
  }
2425
2425
 
2426
- const examples$4 = [
2426
+ const examples$7 = [
2427
2427
  {
2428
2428
  description: "Setup repo with no modifications to branch protection rules",
2429
2429
  example: yaml__default["default"].stringify({
@@ -2475,7 +2475,7 @@ function createGithubRepoPushAction(options) {
2475
2475
  return pluginScaffolderNode.createTemplateAction({
2476
2476
  id: "github:repo:push",
2477
2477
  description: "Initializes a git repository of contents in workspace and publishes it to GitHub.",
2478
- examples: examples$4,
2478
+ examples: examples$7,
2479
2479
  schema: {
2480
2480
  input: {
2481
2481
  type: "object",
@@ -2577,12 +2577,116 @@ function createGithubRepoPushAction(options) {
2577
2577
  });
2578
2578
  }
2579
2579
 
2580
+ const examples$6 = [
2581
+ {
2582
+ description: "Create a GitHub webhook for a repository",
2583
+ example: yaml__default["default"].stringify({
2584
+ steps: [
2585
+ {
2586
+ action: "github:webhook",
2587
+ name: "Create GitHub Webhook",
2588
+ input: {
2589
+ repoUrl: "github.com?repo=repo&owner=owner",
2590
+ webhookUrl: "https://example.com/my-webhook",
2591
+ webhookSecret: "mysecret",
2592
+ events: ["push"],
2593
+ active: true,
2594
+ contentType: "json",
2595
+ insecureSsl: false,
2596
+ token: "my-github-token"
2597
+ }
2598
+ }
2599
+ ]
2600
+ })
2601
+ },
2602
+ {
2603
+ description: "Create a GitHub webhook with minimal configuration",
2604
+ example: yaml__default["default"].stringify({
2605
+ steps: [
2606
+ {
2607
+ action: "github:webhook",
2608
+ name: "Create GitHub Webhook",
2609
+ input: {
2610
+ repoUrl: "github.com?repo=repo&owner=owner",
2611
+ webhookUrl: "https://example.com/my-webhook"
2612
+ }
2613
+ }
2614
+ ]
2615
+ })
2616
+ },
2617
+ {
2618
+ description: "Create a GitHub webhook with custom events",
2619
+ example: yaml__default["default"].stringify({
2620
+ steps: [
2621
+ {
2622
+ action: "github:webhook",
2623
+ name: "Create GitHub Webhook",
2624
+ input: {
2625
+ repoUrl: "github.com?repo=repo&owner=owner",
2626
+ webhookUrl: "https://example.com/my-webhook",
2627
+ events: ["push", "pull_request"]
2628
+ }
2629
+ }
2630
+ ]
2631
+ })
2632
+ },
2633
+ {
2634
+ description: "Create a GitHub webhook with JSON content type",
2635
+ example: yaml__default["default"].stringify({
2636
+ steps: [
2637
+ {
2638
+ action: "github:webhook",
2639
+ name: "Create GitHub Webhook",
2640
+ input: {
2641
+ repoUrl: "github.com?repo=repo&owner=owner",
2642
+ webhookUrl: "https://example.com/my-webhook",
2643
+ contentType: "json"
2644
+ }
2645
+ }
2646
+ ]
2647
+ })
2648
+ },
2649
+ {
2650
+ description: "Create a GitHub webhook with insecure SSL",
2651
+ example: yaml__default["default"].stringify({
2652
+ steps: [
2653
+ {
2654
+ action: "github:webhook",
2655
+ name: "Create GitHub Webhook",
2656
+ input: {
2657
+ repoUrl: "github.com?repo=repo&owner=owner",
2658
+ webhookUrl: "https://example.com/my-webhook",
2659
+ insecureSsl: true
2660
+ }
2661
+ }
2662
+ ]
2663
+ })
2664
+ },
2665
+ {
2666
+ description: "Create an inactive GitHub webhook",
2667
+ example: yaml__default["default"].stringify({
2668
+ steps: [
2669
+ {
2670
+ action: "github:webhook",
2671
+ name: "Create GitHub Webhook",
2672
+ input: {
2673
+ repoUrl: "github.com?repo=repo&owner=owner",
2674
+ webhookUrl: "https://example.com/my-webhook",
2675
+ active: false
2676
+ }
2677
+ }
2678
+ ]
2679
+ })
2680
+ }
2681
+ ];
2682
+
2580
2683
  function createGithubWebhookAction(options) {
2581
2684
  const { integrations, defaultWebhookSecret, githubCredentialsProvider } = options;
2582
2685
  const eventNames = webhooks.emitterEventNames.filter((event) => !event.includes("."));
2583
2686
  return pluginScaffolderNode.createTemplateAction({
2584
2687
  id: "github:webhook",
2585
2688
  description: "Creates webhook for a repository on GitHub.",
2689
+ examples: examples$6,
2586
2690
  schema: {
2587
2691
  input: {
2588
2692
  type: "object",
@@ -2802,11 +2906,92 @@ function createGithubDeployKeyAction(options) {
2802
2906
  });
2803
2907
  }
2804
2908
 
2909
+ const examples$5 = [
2910
+ {
2911
+ description: "Create a GitHub Environment (No Policies, No Variables, No Secrets)",
2912
+ example: yaml__default["default"].stringify({
2913
+ steps: [
2914
+ {
2915
+ action: "github:environment:create",
2916
+ name: "Create Environment",
2917
+ input: {
2918
+ repoUrl: "github.com?repo=repository&owner=owner",
2919
+ name: "envname"
2920
+ }
2921
+ }
2922
+ ]
2923
+ })
2924
+ },
2925
+ {
2926
+ description: "Create a GitHub Environment with Protected Branch Policy",
2927
+ example: yaml__default["default"].stringify({
2928
+ steps: [
2929
+ {
2930
+ action: "github:environment:create",
2931
+ name: "Create Environment",
2932
+ input: {
2933
+ repoUrl: "github.com?repo=repository&owner=owner",
2934
+ name: "envname",
2935
+ deploymentBranchPolicy: {
2936
+ protected_branches: true,
2937
+ custom_branch_policies: false
2938
+ }
2939
+ }
2940
+ }
2941
+ ]
2942
+ })
2943
+ },
2944
+ {
2945
+ description: "Create a GitHub Environment with Custom Branch Policies",
2946
+ example: yaml__default["default"].stringify({
2947
+ steps: [
2948
+ {
2949
+ action: "github:environment:create",
2950
+ name: "Create Environment",
2951
+ input: {
2952
+ repoUrl: "github.com?repo=repository&owner=owner",
2953
+ name: "envname",
2954
+ deploymentBranchPolicy: {
2955
+ protected_branches: false,
2956
+ custom_branch_policies: true
2957
+ },
2958
+ customBranchPolicyNames: ["main", "*.*.*"]
2959
+ }
2960
+ }
2961
+ ]
2962
+ })
2963
+ },
2964
+ {
2965
+ description: "Create a GitHub Environment with Environment Variables and Secrets",
2966
+ example: yaml__default["default"].stringify({
2967
+ steps: [
2968
+ {
2969
+ action: "github:environment:create",
2970
+ name: "Create Environment",
2971
+ input: {
2972
+ repoUrl: "github.com?repo=repository&owner=owner",
2973
+ name: "envname",
2974
+ environmentVariables: {
2975
+ key1: "val1",
2976
+ key2: "val2"
2977
+ },
2978
+ secrets: {
2979
+ secret1: "supersecret1",
2980
+ secret2: "supersecret2"
2981
+ }
2982
+ }
2983
+ }
2984
+ ]
2985
+ })
2986
+ }
2987
+ ];
2988
+
2805
2989
  function createGithubEnvironmentAction(options) {
2806
2990
  const { integrations } = options;
2807
2991
  return pluginScaffolderNode.createTemplateAction({
2808
2992
  id: "github:environment:create",
2809
2993
  description: "Creates Deployment Environments",
2994
+ examples: examples$5,
2810
2995
  schema: {
2811
2996
  input: {
2812
2997
  type: "object",
@@ -2949,7 +3134,7 @@ function createGithubEnvironmentAction(options) {
2949
3134
  });
2950
3135
  }
2951
3136
 
2952
- const examples$3 = [
3137
+ const examples$4 = [
2953
3138
  {
2954
3139
  description: "Initializes a git repository of the content in the workspace, and publishes it to Azure.",
2955
3140
  example: yaml__default["default"].stringify({
@@ -3004,7 +3189,7 @@ function createPublishAzureAction(options) {
3004
3189
  const { integrations, config } = options;
3005
3190
  return pluginScaffolderNode.createTemplateAction({
3006
3191
  id: "publish:azure",
3007
- examples: examples$3,
3192
+ examples: examples$4,
3008
3193
  description: "Initializes a git repository of the content in the workspace, and publishes it to Azure.",
3009
3194
  schema: {
3010
3195
  input: {
@@ -3146,7 +3331,7 @@ function createPublishAzureAction(options) {
3146
3331
  });
3147
3332
  }
3148
3333
 
3149
- const examples$2 = [
3334
+ const examples$3 = [
3150
3335
  {
3151
3336
  description: "Initializes a git repository of contents in workspace and publish it to Bitbucket with default configuration.",
3152
3337
  example: yaml__default["default"].stringify({
@@ -3442,7 +3627,7 @@ function createPublishBitbucketAction(options) {
3442
3627
  return pluginScaffolderNode.createTemplateAction({
3443
3628
  id: "publish:bitbucket",
3444
3629
  description: "Initializes a git repository of the content in the workspace, and publishes it to Bitbucket.",
3445
- examples: examples$2,
3630
+ examples: examples$3,
3446
3631
  schema: {
3447
3632
  input: {
3448
3633
  type: "object",
@@ -4480,7 +4665,7 @@ Change-Id: ${changeId}`;
4480
4665
  });
4481
4666
  }
4482
4667
 
4483
- const examples$1 = [
4668
+ const examples$2 = [
4484
4669
  {
4485
4670
  description: "Initializes a git repository of contents in workspace and publish it to GitHub with default configuration.",
4486
4671
  example: yaml__default["default"].stringify({
@@ -4536,7 +4721,7 @@ function createPublishGithubAction(options) {
4536
4721
  return pluginScaffolderNode.createTemplateAction({
4537
4722
  id: "publish:github",
4538
4723
  description: "Initializes a git repository of contents in workspace and publishes it to GitHub.",
4539
- examples: examples$1,
4724
+ examples: examples$2,
4540
4725
  schema: {
4541
4726
  input: {
4542
4727
  type: "object",
@@ -4761,6 +4946,195 @@ async function deserializeDirectoryContents(targetPath, files) {
4761
4946
  }
4762
4947
  }
4763
4948
 
4949
+ const examples$1 = [
4950
+ {
4951
+ description: "Create a pull request",
4952
+ example: yaml__default["default"].stringify({
4953
+ steps: [
4954
+ {
4955
+ action: "publish:github:pull-request",
4956
+ name: "Create a pull reuqest",
4957
+ input: {
4958
+ repoUrl: "github.com?repo=repo&owner=owner",
4959
+ branchName: "new-app",
4960
+ title: "Create my new app",
4961
+ description: "This PR is really good"
4962
+ }
4963
+ }
4964
+ ]
4965
+ })
4966
+ },
4967
+ {
4968
+ description: "Create a pull request with target branch name",
4969
+ example: yaml__default["default"].stringify({
4970
+ steps: [
4971
+ {
4972
+ action: "publish:github:pull-request",
4973
+ name: "Create a pull reuqest with target branch name",
4974
+ input: {
4975
+ repoUrl: "github.com?repo=repo&owner=owner",
4976
+ branchName: "new-app",
4977
+ title: "Create my new app",
4978
+ description: "This PR is really good",
4979
+ targetBranchName: "test"
4980
+ }
4981
+ }
4982
+ ]
4983
+ })
4984
+ },
4985
+ {
4986
+ description: "Create a pull request as draft",
4987
+ example: yaml__default["default"].stringify({
4988
+ steps: [
4989
+ {
4990
+ action: "publish:github:pull-request",
4991
+ name: "Create a pull reuqest as draft",
4992
+ input: {
4993
+ repoUrl: "github.com?repo=repo&owner=owner",
4994
+ branchName: "new-app",
4995
+ title: "Create my new app",
4996
+ description: "This PR is really good",
4997
+ draft: true
4998
+ }
4999
+ }
5000
+ ]
5001
+ })
5002
+ },
5003
+ {
5004
+ description: "Create a pull request with target path",
5005
+ example: yaml__default["default"].stringify({
5006
+ steps: [
5007
+ {
5008
+ action: "publish:github:pull-request",
5009
+ name: "Create a pull reuqest with target path",
5010
+ input: {
5011
+ repoUrl: "github.com?repo=repo&owner=owner",
5012
+ branchName: "new-app",
5013
+ title: "Create my new app",
5014
+ description: "This PR is really good",
5015
+ targetPath: "targetPath"
5016
+ }
5017
+ }
5018
+ ]
5019
+ })
5020
+ },
5021
+ {
5022
+ description: "Create a pull request with source path",
5023
+ example: yaml__default["default"].stringify({
5024
+ steps: [
5025
+ {
5026
+ action: "publish:github:pull-request",
5027
+ name: "Create a pull reuqest with source path",
5028
+ input: {
5029
+ repoUrl: "github.com?repo=repo&owner=owner",
5030
+ branchName: "new-app",
5031
+ title: "Create my new app",
5032
+ description: "This PR is really good",
5033
+ sourcePath: "source"
5034
+ }
5035
+ }
5036
+ ]
5037
+ })
5038
+ },
5039
+ {
5040
+ description: "Create a pull request with token",
5041
+ example: yaml__default["default"].stringify({
5042
+ steps: [
5043
+ {
5044
+ action: "publish:github:pull-request",
5045
+ name: "Create a pull reuqest",
5046
+ input: {
5047
+ repoUrl: "github.com?repo=repo&owner=owner",
5048
+ branchName: "new-app",
5049
+ title: "Create my new app",
5050
+ description: "This PR is really good",
5051
+ token: "gph_YourGitHubToken"
5052
+ }
5053
+ }
5054
+ ]
5055
+ })
5056
+ },
5057
+ {
5058
+ description: "Create a pull request with reviewers",
5059
+ example: yaml__default["default"].stringify({
5060
+ steps: [
5061
+ {
5062
+ action: "publish:github:pull-request",
5063
+ name: "Create a pull reuqest with reviewers",
5064
+ input: {
5065
+ repoUrl: "github.com?repo=repo&owner=owner",
5066
+ branchName: "new-app",
5067
+ title: "Create my new app",
5068
+ description: "This PR is really good",
5069
+ reviewers: ["foobar"]
5070
+ }
5071
+ }
5072
+ ]
5073
+ })
5074
+ },
5075
+ {
5076
+ description: "Create a pull request with team reviewers",
5077
+ example: yaml__default["default"].stringify({
5078
+ steps: [
5079
+ {
5080
+ action: "publish:github:pull-request",
5081
+ name: "Create a pull reuqest with team reviewers",
5082
+ input: {
5083
+ repoUrl: "github.com?repo=repo&owner=owner",
5084
+ branchName: "new-app",
5085
+ title: "Create my new app",
5086
+ description: "This PR is really good",
5087
+ teamReviewers: ["team-foo"]
5088
+ }
5089
+ }
5090
+ ]
5091
+ })
5092
+ },
5093
+ {
5094
+ description: "Create a pull request with commit message",
5095
+ example: yaml__default["default"].stringify({
5096
+ steps: [
5097
+ {
5098
+ action: "publish:github:pull-request",
5099
+ name: "Create a pull reuqest",
5100
+ input: {
5101
+ repoUrl: "github.com?repo=repo&owner=owner",
5102
+ branchName: "new-app",
5103
+ title: "Create my new app",
5104
+ description: "This PR is really good",
5105
+ commitMessage: "Custom commit message"
5106
+ }
5107
+ }
5108
+ ]
5109
+ })
5110
+ },
5111
+ {
5112
+ description: "Create a pull request with all parameters",
5113
+ example: yaml__default["default"].stringify({
5114
+ steps: [
5115
+ {
5116
+ action: "publish:github:pull-request",
5117
+ name: "Create a pull reuqest",
5118
+ input: {
5119
+ repoUrl: "github.com?repo=repo&owner=owner",
5120
+ branchName: "new-app",
5121
+ title: "Create my new app",
5122
+ description: "This PR is really good",
5123
+ targetBranchName: "test",
5124
+ draft: true,
5125
+ targetPath: "targetPath",
5126
+ sourcePath: "source",
5127
+ token: "gph_YourGitHubToken",
5128
+ reviewers: ["foobar"],
5129
+ teamReviewers: ["team-foo"],
5130
+ commitMessage: "Commit for foo changes"
5131
+ }
5132
+ }
5133
+ ]
5134
+ })
5135
+ }
5136
+ ];
5137
+
4764
5138
  class GithubResponseError extends errors.CustomErrorBase {
4765
5139
  }
4766
5140
  const defaultClientFactory = async ({
@@ -4794,6 +5168,7 @@ const createPublishGithubPullRequestAction = (options) => {
4794
5168
  } = options;
4795
5169
  return pluginScaffolderNode.createTemplateAction({
4796
5170
  id: "publish:github:pull-request",
5171
+ examples: examples$1,
4797
5172
  schema: {
4798
5173
  input: {
4799
5174
  required: ["repoUrl", "title", "description", "branchName"],
@@ -4864,6 +5239,11 @@ const createPublishGithubPullRequestAction = (options) => {
4864
5239
  type: "string",
4865
5240
  title: "Commit Message",
4866
5241
  description: "The commit message for the pull request commit"
5242
+ },
5243
+ update: {
5244
+ type: "boolean",
5245
+ title: "Update",
5246
+ description: "Update pull request if already exists"
4867
5247
  }
4868
5248
  }
4869
5249
  },
@@ -4901,7 +5281,8 @@ const createPublishGithubPullRequestAction = (options) => {
4901
5281
  token: providedToken,
4902
5282
  reviewers,
4903
5283
  teamReviewers,
4904
- commitMessage
5284
+ commitMessage,
5285
+ update
4905
5286
  } = ctx.input;
4906
5287
  const { owner, repo, host } = parseRepoUrl(repoUrl, integrations);
4907
5288
  if (!owner) {
@@ -4961,7 +5342,8 @@ const createPublishGithubPullRequestAction = (options) => {
4961
5342
  ],
4962
5343
  body: description,
4963
5344
  head: branchName,
4964
- draft
5345
+ draft,
5346
+ update
4965
5347
  };
4966
5348
  if (targetBranchName) {
4967
5349
  createOptions.base = targetBranchName;
@@ -7630,4 +8012,4 @@ exports.createRouter = createRouter;
7630
8012
  exports.createWaitAction = createWaitAction;
7631
8013
  exports.scaffolderActionRules = scaffolderActionRules;
7632
8014
  exports.scaffolderTemplateRules = scaffolderTemplateRules;
7633
- //# sourceMappingURL=router-d7df4c2b.cjs.js.map
8015
+ //# sourceMappingURL=router-9c2e178f.cjs.js.map