@backstage/plugin-scaffolder-backend 1.16.5 → 1.16.6-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,7 +81,7 @@ var winston__namespace = /*#__PURE__*/_interopNamespace(winston);
81
81
  var nunjucks__default = /*#__PURE__*/_interopDefaultLegacy(nunjucks);
82
82
  var os__default = /*#__PURE__*/_interopDefaultLegacy(os);
83
83
 
84
- const examples$b = [
84
+ const examples$f = [
85
85
  {
86
86
  description: "Register with the catalog",
87
87
  example: yaml__default["default"].stringify({
@@ -105,7 +105,7 @@ function createCatalogRegisterAction(options) {
105
105
  return pluginScaffolderNode.createTemplateAction({
106
106
  id: id$4,
107
107
  description: "Registers entities from a catalog descriptor file in the workspace into the software catalog.",
108
- examples: examples$b,
108
+ examples: examples$f,
109
109
  schema: {
110
110
  input: {
111
111
  oneOf: [
@@ -229,7 +229,7 @@ function createCatalogRegisterAction(options) {
229
229
  });
230
230
  }
231
231
 
232
- const examples$a = [
232
+ const examples$e = [
233
233
  {
234
234
  description: "Write a catalog yaml file",
235
235
  example: yaml__namespace.stringify({
@@ -273,7 +273,7 @@ function createCatalogWriteAction() {
273
273
  )
274
274
  })
275
275
  },
276
- examples: examples$a,
276
+ examples: examples$e,
277
277
  supportsDryRun: true,
278
278
  async handler(ctx) {
279
279
  ctx.logStream.write(`Writing catalog-info.yaml`);
@@ -287,7 +287,7 @@ function createCatalogWriteAction() {
287
287
  });
288
288
  }
289
289
 
290
- const examples$9 = [
290
+ const examples$d = [
291
291
  {
292
292
  description: "Fetch entity by reference",
293
293
  example: yaml__default["default"].stringify({
@@ -326,7 +326,7 @@ function createFetchCatalogEntityAction(options) {
326
326
  return pluginScaffolderNode.createTemplateAction({
327
327
  id: id$2,
328
328
  description: "Returns entity or entities from the catalog by entity reference(s)",
329
- examples: examples$9,
329
+ examples: examples$d,
330
330
  supportsDryRun: true,
331
331
  schema: {
332
332
  input: zod.z.object({
@@ -401,7 +401,7 @@ function createFetchCatalogEntityAction(options) {
401
401
  });
402
402
  }
403
403
 
404
- const examples$8 = [
404
+ const examples$c = [
405
405
  {
406
406
  description: "Write a debug message",
407
407
  example: yaml__default["default"].stringify({
@@ -439,7 +439,7 @@ function createDebugLogAction() {
439
439
  return pluginScaffolderNode.createTemplateAction({
440
440
  id: id$1,
441
441
  description: "Writes a message into the log or lists all files in the workspace.",
442
- examples: examples$8,
442
+ examples: examples$c,
443
443
  schema: {
444
444
  input: {
445
445
  type: "object",
@@ -486,7 +486,7 @@ async function recursiveReadDir(dir) {
486
486
  return files.reduce((a, f) => a.concat(f), []);
487
487
  }
488
488
 
489
- const examples$7 = [
489
+ const examples$b = [
490
490
  {
491
491
  description: "Waiting for 50 milliseconds",
492
492
  example: yaml__default["default"].stringify({
@@ -549,7 +549,7 @@ function createWaitAction(options) {
549
549
  return pluginScaffolderNode.createTemplateAction({
550
550
  id,
551
551
  description: "Waits for a certain period of time.",
552
- examples: examples$7,
552
+ examples: examples$b,
553
553
  schema: {
554
554
  input: {
555
555
  type: "object",
@@ -594,7 +594,7 @@ function createWaitAction(options) {
594
594
  });
595
595
  }
596
596
 
597
- const examples$6 = [
597
+ const examples$a = [
598
598
  {
599
599
  description: "Downloads content and places it in the workspace.",
600
600
  example: yaml__default["default"].stringify({
@@ -633,7 +633,7 @@ function createFetchPlainAction(options) {
633
633
  const { reader, integrations } = options;
634
634
  return pluginScaffolderNode.createTemplateAction({
635
635
  id: ACTION_ID,
636
- examples: examples$6,
636
+ examples: examples$a,
637
637
  description: "Downloads content and places it in the workspace, or optionally in a subdirectory specified by the `targetPath` input option.",
638
638
  schema: {
639
639
  input: {
@@ -670,7 +670,7 @@ function createFetchPlainAction(options) {
670
670
  });
671
671
  }
672
672
 
673
- const examples$5 = [
673
+ const examples$9 = [
674
674
  {
675
675
  description: "Downloads a file and places it in the workspace.",
676
676
  example: yaml__default["default"].stringify({
@@ -694,7 +694,7 @@ function createFetchPlainFileAction(options) {
694
694
  return pluginScaffolderNode.createTemplateAction({
695
695
  id: "fetch:plain:file",
696
696
  description: "Downloads single file and places it in the workspace.",
697
- examples: examples$5,
697
+ examples: examples$9,
698
698
  schema: {
699
699
  input: {
700
700
  type: "object",
@@ -962,7 +962,7 @@ const createDefaultFilters = ({
962
962
  };
963
963
  };
964
964
 
965
- const examples$4 = [
965
+ const examples$8 = [
966
966
  {
967
967
  description: "Downloads a skelaton directory that lives alongside the template file and fill it out with values.",
968
968
  example: yaml__default["default"].stringify({
@@ -998,7 +998,7 @@ function createFetchTemplateAction(options) {
998
998
  return pluginScaffolderNode.createTemplateAction({
999
999
  id: "fetch:template",
1000
1000
  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.",
1001
- examples: examples$4,
1001
+ examples: examples$8,
1002
1002
  schema: {
1003
1003
  input: {
1004
1004
  type: "object",
@@ -1203,7 +1203,7 @@ function containsSkippedContent(localOutputPath) {
1203
1203
  return localOutputPath === "" || localOutputPath.startsWith("/") || localOutputPath.includes("//");
1204
1204
  }
1205
1205
 
1206
- const examples$3 = [
1206
+ const examples$7 = [
1207
1207
  {
1208
1208
  description: "Delete specified files",
1209
1209
  example: yaml__namespace.stringify({
@@ -1225,7 +1225,7 @@ const createFilesystemDeleteAction = () => {
1225
1225
  return pluginScaffolderNode.createTemplateAction({
1226
1226
  id: "fs:delete",
1227
1227
  description: "Deletes files and directories from the workspace",
1228
- examples: examples$3,
1228
+ examples: examples$7,
1229
1229
  schema: {
1230
1230
  input: {
1231
1231
  required: ["files"],
@@ -1262,7 +1262,7 @@ const createFilesystemDeleteAction = () => {
1262
1262
  });
1263
1263
  };
1264
1264
 
1265
- const examples$2 = [
1265
+ const examples$6 = [
1266
1266
  {
1267
1267
  description: "Rename specified files ",
1268
1268
  example: yaml__namespace.stringify({
@@ -1288,7 +1288,7 @@ const createFilesystemRenameAction = () => {
1288
1288
  return pluginScaffolderNode.createTemplateAction({
1289
1289
  id: "fs:rename",
1290
1290
  description: "Renames files and directories within the workspace",
1291
- examples: examples$2,
1291
+ examples: examples$6,
1292
1292
  schema: {
1293
1293
  input: {
1294
1294
  required: ["files"],
@@ -1770,11 +1770,68 @@ async function validateAccessTeam(client, access) {
1770
1770
  }
1771
1771
  }
1772
1772
 
1773
+ const examples$5 = [
1774
+ {
1775
+ description: "GitHub Action Workflow Without Inputs.",
1776
+ example: yaml__default["default"].stringify({
1777
+ steps: [
1778
+ {
1779
+ action: "github:actions:dispatch",
1780
+ name: "Dispatch Github Action Workflow",
1781
+ input: {
1782
+ repoUrl: "github.com?repo=repo&owner=owner",
1783
+ workflowId: "WORKFLOW_ID",
1784
+ branchOrTagName: "main"
1785
+ }
1786
+ }
1787
+ ]
1788
+ })
1789
+ },
1790
+ {
1791
+ description: "GitHub Action Workflow With Inputs",
1792
+ example: yaml__default["default"].stringify({
1793
+ steps: [
1794
+ {
1795
+ action: "github:actions:dispatch",
1796
+ name: "Dispatch Github Action Workflow with inputs",
1797
+ input: {
1798
+ repoUrl: "github.com?repo=repo&owner=owner",
1799
+ workflowId: "WORKFLOW_ID",
1800
+ branchOrTagName: "main",
1801
+ workflowInputs: {
1802
+ input1: "value1",
1803
+ input2: "value2"
1804
+ }
1805
+ }
1806
+ }
1807
+ ]
1808
+ })
1809
+ },
1810
+ {
1811
+ description: "GitHub Action Workflow With Custom Token",
1812
+ example: yaml__default["default"].stringify({
1813
+ steps: [
1814
+ {
1815
+ action: "github:actions:dispatch",
1816
+ name: "Dispatch GitHub Action Workflow (custom token)",
1817
+ input: {
1818
+ repoUrl: "github.com?repo=reponame&owner=owner",
1819
+ workflowId: "WORKFLOW_ID",
1820
+ branchOrTagName: "release-1.0",
1821
+ token: "${{ secrets.MY_CUSTOM_TOKEN }}"
1822
+ }
1823
+ }
1824
+ ]
1825
+ })
1826
+ }
1827
+ ];
1828
+
1773
1829
  function createGithubActionsDispatchAction(options) {
1774
1830
  const { integrations, githubCredentialsProvider } = options;
1775
1831
  return pluginScaffolderNode.createTemplateAction({
1776
1832
  id: "github:actions:dispatch",
1777
1833
  description: "Dispatches a GitHub Action workflow for a given branch or tag",
1834
+ examples: examples$5,
1778
1835
  schema: {
1779
1836
  input: {
1780
1837
  type: "object",
@@ -2170,7 +2227,7 @@ const commitHash = {
2170
2227
  type: "string"
2171
2228
  };
2172
2229
 
2173
- const examples$1 = [
2230
+ const examples$4 = [
2174
2231
  {
2175
2232
  description: "Creates a GitHub repository with default configuration.",
2176
2233
  example: yaml__default["default"].stringify({
@@ -2223,7 +2280,7 @@ function createGithubRepoCreateAction(options) {
2223
2280
  return pluginScaffolderNode.createTemplateAction({
2224
2281
  id: "github:repo:create",
2225
2282
  description: "Creates a GitHub repository.",
2226
- examples: examples$1,
2283
+ examples: examples$4,
2227
2284
  schema: {
2228
2285
  input: {
2229
2286
  type: "object",
@@ -2330,7 +2387,7 @@ function createGithubRepoCreateAction(options) {
2330
2387
  });
2331
2388
  }
2332
2389
 
2333
- const examples = [
2390
+ const examples$3 = [
2334
2391
  {
2335
2392
  description: "Setup repo with no modifications to branch protection rules",
2336
2393
  example: yaml__default["default"].stringify({
@@ -2382,7 +2439,7 @@ function createGithubRepoPushAction(options) {
2382
2439
  return pluginScaffolderNode.createTemplateAction({
2383
2440
  id: "github:repo:push",
2384
2441
  description: "Initializes a git repository of contents in workspace and publishes it to GitHub.",
2385
- examples,
2442
+ examples: examples$3,
2386
2443
  schema: {
2387
2444
  input: {
2388
2445
  type: "object",
@@ -2929,7 +2986,7 @@ function createPublishAzureAction(options) {
2929
2986
  }
2930
2987
  },
2931
2988
  async handler(ctx) {
2932
- var _a;
2989
+ var _a, _b;
2933
2990
  const {
2934
2991
  repoUrl,
2935
2992
  defaultBranch = "master",
@@ -2946,18 +3003,16 @@ function createPublishAzureAction(options) {
2946
3003
  `Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing organization`
2947
3004
  );
2948
3005
  }
2949
- const integrationConfig = integrations.azure.byHost(host);
2950
- if (!integrationConfig) {
3006
+ const url = `https://${host}/${organization}`;
3007
+ const credentialProvider = integration.DefaultAzureDevOpsCredentialsProvider.fromIntegrations(integrations);
3008
+ const credentials = await credentialProvider.getCredentials({ url });
3009
+ if (credentials === void 0 && ctx.input.token === void 0) {
2951
3010
  throw new errors.InputError(
2952
- `No matching integration configuration for host ${host}, please check your integrations config`
3011
+ `No credentials provided ${url}, please check your integrations config`
2953
3012
  );
2954
3013
  }
2955
- if (!integrationConfig.config.token && !ctx.input.token) {
2956
- throw new errors.InputError(`No token provided for Azure Integration ${host}`);
2957
- }
2958
- const token = (_a = ctx.input.token) != null ? _a : integrationConfig.config.token;
2959
- const authHandler = azureDevopsNodeApi.getPersonalAccessTokenHandler(token);
2960
- const webApi = new azureDevopsNodeApi.WebApi(`https://${host}/${organization}`, authHandler);
3014
+ const authHandler = ctx.input.token || (credentials == null ? void 0 : credentials.type) === "pat" ? azureDevopsNodeApi.getPersonalAccessTokenHandler((_a = ctx.input.token) != null ? _a : credentials.token) : azureDevopsNodeApi.getBearerHandler(credentials.token);
3015
+ const webApi = new azureDevopsNodeApi.WebApi(url, authHandler);
2961
3016
  const client = await webApi.getGitApi();
2962
3017
  const createOptions = { name: repo };
2963
3018
  const returnedRepo = await client.createRepository(createOptions, owner);
@@ -2982,14 +3037,15 @@ function createPublishAzureAction(options) {
2982
3037
  name: gitAuthorName ? gitAuthorName : config.getOptionalString("scaffolder.defaultAuthor.name"),
2983
3038
  email: gitAuthorEmail ? gitAuthorEmail : config.getOptionalString("scaffolder.defaultAuthor.email")
2984
3039
  };
3040
+ const auth = ctx.input.token || (credentials == null ? void 0 : credentials.type) === "pat" ? {
3041
+ username: "notempty",
3042
+ password: (_b = ctx.input.token) != null ? _b : credentials.token
3043
+ } : { token: credentials.token };
2985
3044
  const commitResult = await initRepoAndPush({
2986
3045
  dir: getRepoSourceDirectory(ctx.workspacePath, ctx.input.sourcePath),
2987
3046
  remoteUrl,
2988
3047
  defaultBranch,
2989
- auth: {
2990
- username: "notempty",
2991
- password: token
2992
- },
3048
+ auth,
2993
3049
  logger: ctx.logger,
2994
3050
  commitMessage: gitCommitMessage ? gitCommitMessage : config.getOptionalString("scaffolder.defaultCommitMessage"),
2995
3051
  gitAuthorInfo
@@ -3002,6 +3058,175 @@ function createPublishAzureAction(options) {
3002
3058
  });
3003
3059
  }
3004
3060
 
3061
+ const examples$2 = [
3062
+ {
3063
+ description: "Initializes a git repository of contents in workspace and publish it to Bitbucket with default configuration.",
3064
+ example: yaml__default["default"].stringify({
3065
+ steps: [
3066
+ {
3067
+ id: "publish",
3068
+ action: "publish:bitbucket",
3069
+ name: "Publish to Bitbucket",
3070
+ input: {
3071
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project"
3072
+ }
3073
+ }
3074
+ ]
3075
+ })
3076
+ },
3077
+ {
3078
+ description: "Add a description.",
3079
+ example: yaml__default["default"].stringify({
3080
+ steps: [
3081
+ {
3082
+ id: "publish",
3083
+ action: "publish:bitbucket",
3084
+ name: "Publish to Bitbucket",
3085
+ input: {
3086
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project",
3087
+ description: "Initialize a git repository"
3088
+ }
3089
+ }
3090
+ ]
3091
+ })
3092
+ },
3093
+ {
3094
+ description: "Change visibility of the repository.",
3095
+ example: yaml__default["default"].stringify({
3096
+ steps: [
3097
+ {
3098
+ id: "publish",
3099
+ action: "publish:bitbucket",
3100
+ name: "Publish to Bitbucket",
3101
+ input: {
3102
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project",
3103
+ description: "Initialize a git repository",
3104
+ repoVisibility: "public"
3105
+ }
3106
+ }
3107
+ ]
3108
+ })
3109
+ },
3110
+ {
3111
+ description: "Set the default branch.",
3112
+ example: yaml__default["default"].stringify({
3113
+ steps: [
3114
+ {
3115
+ id: "publish",
3116
+ action: "publish:bitbucket",
3117
+ name: "Publish to Bitbucket",
3118
+ input: {
3119
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project",
3120
+ description: "Initialize a git repository",
3121
+ repoVisibility: "public",
3122
+ defaultBranch: "main"
3123
+ }
3124
+ }
3125
+ ]
3126
+ })
3127
+ },
3128
+ {
3129
+ description: "Specify a source path within the workspace.",
3130
+ example: yaml__default["default"].stringify({
3131
+ steps: [
3132
+ {
3133
+ id: "publish",
3134
+ action: "publish:bitbucket",
3135
+ name: "Publish to Bitbucket",
3136
+ input: {
3137
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project",
3138
+ description: "Initialize a git repository",
3139
+ repoVisibility: "public",
3140
+ defaultBranch: "main",
3141
+ sourcePath: "./repoRoot"
3142
+ }
3143
+ }
3144
+ ]
3145
+ })
3146
+ },
3147
+ {
3148
+ description: "Enable LFS for the repository.",
3149
+ example: yaml__default["default"].stringify({
3150
+ steps: [
3151
+ {
3152
+ id: "publish",
3153
+ action: "publish:bitbucket",
3154
+ name: "Publish to Bitbucket",
3155
+ input: {
3156
+ repoUrl: "hosted.bitbucket.com?project=project&repo=repo",
3157
+ description: "Initialize a git repository",
3158
+ repoVisibility: "public",
3159
+ defaultBranch: "main",
3160
+ sourcePath: "./repoRoot",
3161
+ enableLFS: true
3162
+ }
3163
+ }
3164
+ ]
3165
+ })
3166
+ },
3167
+ {
3168
+ description: "Provide an authentication token for Bitbucket.",
3169
+ example: yaml__default["default"].stringify({
3170
+ steps: [
3171
+ {
3172
+ id: "publish",
3173
+ action: "publish:bitbucket",
3174
+ name: "Publish to Bitbucket",
3175
+ input: {
3176
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project",
3177
+ description: "Initialize a git repository",
3178
+ repoVisibility: "public",
3179
+ defaultBranch: "main",
3180
+ token: "your-auth-token"
3181
+ }
3182
+ }
3183
+ ]
3184
+ })
3185
+ },
3186
+ {
3187
+ description: "Set a custom commit message.",
3188
+ example: yaml__default["default"].stringify({
3189
+ steps: [
3190
+ {
3191
+ id: "publish",
3192
+ action: "publish:bitbucket",
3193
+ name: "Publish to Bitbucket",
3194
+ input: {
3195
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project",
3196
+ description: "Initialize a git repository",
3197
+ repoVisibility: "public",
3198
+ defaultBranch: "main",
3199
+ token: "your-auth-token",
3200
+ gitCommitMessage: "Initial commit with custom message"
3201
+ }
3202
+ }
3203
+ ]
3204
+ })
3205
+ },
3206
+ {
3207
+ description: "Set a custom author name and email for the commit.",
3208
+ example: yaml__default["default"].stringify({
3209
+ steps: [
3210
+ {
3211
+ id: "publish",
3212
+ action: "publish:bitbucket",
3213
+ name: "Publish to Bitbucket",
3214
+ input: {
3215
+ repoUrl: "bitbucket.org?repo=repo&workspace=workspace&project=project",
3216
+ description: "Initialize a git repository",
3217
+ repoVisibility: "public",
3218
+ defaultBranch: "main",
3219
+ token: "your-auth-token",
3220
+ gitCommitMessage: "Initial commit with custom message",
3221
+ gitAuthorName: "Your Name",
3222
+ gitAuthorEmail: "your.email@example.com"
3223
+ }
3224
+ }
3225
+ ]
3226
+ })
3227
+ }
3228
+ ];
3229
+
3005
3230
  const createBitbucketCloudRepository = async (opts) => {
3006
3231
  const {
3007
3232
  workspace,
@@ -3129,6 +3354,7 @@ function createPublishBitbucketAction(options) {
3129
3354
  return pluginScaffolderNode.createTemplateAction({
3130
3355
  id: "publish:bitbucket",
3131
3356
  description: "Initializes a git repository of the content in the workspace, and publishes it to Bitbucket.",
3357
+ examples: examples$2,
3132
3358
  schema: {
3133
3359
  input: {
3134
3360
  type: "object",
@@ -4166,11 +4392,63 @@ Change-Id: ${changeId}`;
4166
4392
  });
4167
4393
  }
4168
4394
 
4395
+ const examples$1 = [
4396
+ {
4397
+ description: "Initializes a git repository of contents in workspace and publish it to GitHub with default configuration.",
4398
+ example: yaml__default["default"].stringify({
4399
+ steps: [
4400
+ {
4401
+ id: "publish",
4402
+ action: "publish:github",
4403
+ name: "Publish to GitHub",
4404
+ input: {
4405
+ repoUrl: "github.com?repo=repo&owner=owner"
4406
+ }
4407
+ }
4408
+ ]
4409
+ })
4410
+ },
4411
+ {
4412
+ description: "Add a description.",
4413
+ example: yaml__default["default"].stringify({
4414
+ steps: [
4415
+ {
4416
+ id: "publish",
4417
+ action: "publish:github",
4418
+ name: "Publish to GitHub",
4419
+ input: {
4420
+ repoUrl: "github.com?repo=repo&owner=owner",
4421
+ description: "Initialize a git repository"
4422
+ }
4423
+ }
4424
+ ]
4425
+ })
4426
+ },
4427
+ {
4428
+ description: "Change visibility of the repository.",
4429
+ example: yaml__default["default"].stringify({
4430
+ steps: [
4431
+ {
4432
+ id: "publish",
4433
+ action: "publish:github",
4434
+ name: "Publish to GitHub",
4435
+ input: {
4436
+ repoUrl: "github.com?repo=repo&owner=owner",
4437
+ description: "Initialize a git repository",
4438
+ repoVisibility: "public"
4439
+ }
4440
+ }
4441
+ ]
4442
+ })
4443
+ }
4444
+ ];
4445
+
4169
4446
  function createPublishGithubAction(options) {
4170
4447
  const { integrations, config, githubCredentialsProvider } = options;
4171
4448
  return pluginScaffolderNode.createTemplateAction({
4172
4449
  id: "publish:github",
4173
4450
  description: "Initializes a git repository of contents in workspace and publishes it to GitHub.",
4451
+ examples: examples$1,
4174
4452
  schema: {
4175
4453
  input: {
4176
4454
  type: "object",
@@ -4648,11 +4926,63 @@ const createPublishGithubPullRequestAction = (options) => {
4648
4926
  }
4649
4927
  };
4650
4928
 
4929
+ const examples = [
4930
+ {
4931
+ description: "Initializes a git repository of the content in the workspace, and publishes it to GitLab.",
4932
+ example: yaml__default["default"].stringify({
4933
+ steps: [
4934
+ {
4935
+ id: "publish",
4936
+ action: "publish:gitlab",
4937
+ name: "Publish to GitLab",
4938
+ input: {
4939
+ repoUrl: "gitlab.com?repo=project_name&owner=group_name"
4940
+ }
4941
+ }
4942
+ ]
4943
+ })
4944
+ },
4945
+ {
4946
+ description: "Add a description.",
4947
+ example: yaml__default["default"].stringify({
4948
+ steps: [
4949
+ {
4950
+ id: "publish",
4951
+ action: "publish:gitlab",
4952
+ name: "Publish to GitLab",
4953
+ input: {
4954
+ repoUrl: "gitlab.com?repo=project_name&owner=group_name",
4955
+ description: "Initialize a git repository"
4956
+ }
4957
+ }
4958
+ ]
4959
+ })
4960
+ },
4961
+ {
4962
+ description: "Sets the commit message on the repository. The default value is `initial commit`.",
4963
+ example: yaml__default["default"].stringify({
4964
+ steps: [
4965
+ {
4966
+ id: "publish",
4967
+ action: "publish:gitlab",
4968
+ name: "Publish to GitLab",
4969
+ input: {
4970
+ repoUrl: "gitlab.com?repo=project_name&owner=group_name",
4971
+ description: "Initialize a git repository",
4972
+ gitCommitMessage: "Started a project."
4973
+ }
4974
+ }
4975
+ ]
4976
+ })
4977
+ }
4978
+ ];
4979
+
4651
4980
  function createPublishGitlabAction(options) {
4652
4981
  const { integrations, config } = options;
4653
4982
  return pluginScaffolderNode.createTemplateAction({
4654
4983
  id: "publish:gitlab",
4655
4984
  description: "Initializes a git repository of the content in the workspace, and publishes it to GitLab.",
4985
+ examples,
4656
4986
  schema: {
4657
4987
  input: {
4658
4988
  type: "object",
@@ -5171,7 +5501,13 @@ function isPluginDatabaseManager(opt) {
5171
5501
  }
5172
5502
  const parseSqlDateToIsoString = (input) => {
5173
5503
  if (typeof input === "string") {
5174
- return luxon.DateTime.fromSQL(input, { zone: "UTC" }).toISO();
5504
+ const parsed = luxon.DateTime.fromSQL(input, { zone: "UTC" });
5505
+ if (!parsed.isValid) {
5506
+ throw new Error(
5507
+ `Failed to parse database timestamp '${input}', ${parsed.invalidReason}: ${parsed.invalidExplanation}`
5508
+ );
5509
+ }
5510
+ return parsed.toISO();
5175
5511
  }
5176
5512
  return input;
5177
5513
  };
@@ -5306,13 +5642,19 @@ class DatabaseTaskStore {
5306
5642
  }
5307
5643
  async listStaleTasks(options) {
5308
5644
  const { timeoutS } = options;
5309
- const rawRows = await this.db("tasks").where("status", "processing").andWhere(
5310
- "last_heartbeat_at",
5311
- "<=",
5312
- this.db.client.config.client.includes("sqlite3") ? this.db.raw(`datetime('now', ?)`, [`-${timeoutS} seconds`]) : this.db.raw(`? - interval '${timeoutS} seconds'`, [
5313
- this.db.fn.now()
5314
- ])
5315
- );
5645
+ let heartbeatInterval = this.db.raw(`? - interval '${timeoutS} seconds'`, [
5646
+ this.db.fn.now()
5647
+ ]);
5648
+ if (this.db.client.config.client.includes("mysql")) {
5649
+ heartbeatInterval = this.db.raw(
5650
+ `date_sub(now(), interval ${timeoutS} second)`
5651
+ );
5652
+ } else if (this.db.client.config.client.includes("sqlite3")) {
5653
+ heartbeatInterval = this.db.raw(`datetime('now', ?)`, [
5654
+ `-${timeoutS} seconds`
5655
+ ]);
5656
+ }
5657
+ const rawRows = await this.db("tasks").where("status", "processing").andWhere("last_heartbeat_at", "<=", heartbeatInterval);
5316
5658
  const tasks = rawRows.map((row) => ({
5317
5659
  taskId: row.id
5318
5660
  }));
@@ -6995,4 +7337,4 @@ exports.createRouter = createRouter;
6995
7337
  exports.createWaitAction = createWaitAction;
6996
7338
  exports.scaffolderActionRules = scaffolderActionRules;
6997
7339
  exports.scaffolderTemplateRules = scaffolderTemplateRules;
6998
- //# sourceMappingURL=ScaffolderEntitiesProcessor-4b7489dd.cjs.js.map
7340
+ //# sourceMappingURL=ScaffolderEntitiesProcessor-519a7b88.cjs.js.map