@backstage/plugin-scaffolder-backend 1.16.4 → 1.16.6-next.1
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 +35 -43
- package/alpha/package.json +1 -1
- package/dist/alpha.cjs.js +1 -1
- package/dist/cjs/{ScaffolderEntitiesProcessor-4b7489dd.cjs.js → ScaffolderEntitiesProcessor-96675669.cjs.js} +212 -46
- package/dist/cjs/ScaffolderEntitiesProcessor-96675669.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +18 -18
- package/dist/cjs/ScaffolderEntitiesProcessor-4b7489dd.cjs.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,63 +1,55 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-backend
|
|
2
2
|
|
|
3
|
-
## 1.16.
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
- @backstage/
|
|
16
|
-
- @backstage/
|
|
17
|
-
- @backstage/
|
|
18
|
-
- @backstage/plugin-
|
|
19
|
-
- @backstage/
|
|
20
|
-
- @backstage/plugin-
|
|
21
|
-
- @backstage/
|
|
22
|
-
- @backstage/plugin-
|
|
23
|
-
- @backstage/
|
|
24
|
-
- @backstage/catalog-client@1.4.3
|
|
25
|
-
- @backstage/catalog-model@1.4.1
|
|
26
|
-
- @backstage/config@1.0.8
|
|
3
|
+
## 1.16.6-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f3c0b95e3ef1: Add examples for `github:actions:dispatch` scaffolder actions.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/plugin-catalog-backend@1.13.0-next.1
|
|
10
|
+
- @backstage/config@1.1.0-next.0
|
|
11
|
+
- @backstage/integration@1.7.0-next.1
|
|
12
|
+
- @backstage/backend-tasks@0.5.8-next.1
|
|
13
|
+
- @backstage/backend-common@0.19.5-next.1
|
|
14
|
+
- @backstage/backend-plugin-api@0.6.3-next.1
|
|
15
|
+
- @backstage/catalog-model@1.4.2-next.0
|
|
16
|
+
- @backstage/plugin-auth-node@0.3.0-next.1
|
|
17
|
+
- @backstage/plugin-permission-common@0.7.8-next.0
|
|
18
|
+
- @backstage/plugin-permission-node@0.7.14-next.1
|
|
19
|
+
- @backstage/plugin-scaffolder-node@0.2.3-next.1
|
|
20
|
+
- @backstage/plugin-catalog-node@1.4.4-next.1
|
|
21
|
+
- @backstage/catalog-client@1.4.4-next.0
|
|
22
|
+
- @backstage/plugin-catalog-common@1.0.16-next.0
|
|
23
|
+
- @backstage/plugin-scaffolder-common@1.4.1-next.0
|
|
27
24
|
- @backstage/errors@1.2.1
|
|
28
25
|
- @backstage/types@1.1.0
|
|
29
|
-
- @backstage/plugin-catalog-common@1.0.15
|
|
30
|
-
- @backstage/plugin-permission-common@0.7.7
|
|
31
|
-
- @backstage/plugin-scaffolder-common@1.4.0
|
|
32
26
|
|
|
33
|
-
## 1.16.
|
|
27
|
+
## 1.16.3-next.0
|
|
34
28
|
|
|
35
29
|
### Patch Changes
|
|
36
30
|
|
|
31
|
+
- a4989552d828: Add examples for `publish:github` and `publish:gitlab` scaffolder actions.
|
|
32
|
+
- 5f1a92b9f19f: Use `DefaultAzureDevOpsCredentialsProvider` to retrieve credentials for Azure DevOps.
|
|
33
|
+
- fb57a4694fc6: Fixed the plugin and module ID of the alpha `catalogModuleTemplateKind` export.
|
|
34
|
+
- cfc3ca6ce060: Changes needed to support MySQL
|
|
37
35
|
- Updated dependencies
|
|
38
|
-
- @backstage/
|
|
39
|
-
- @backstage/plugin-
|
|
40
|
-
- @backstage/backend-common@0.19.
|
|
41
|
-
- @backstage/
|
|
42
|
-
- @backstage/backend-tasks@0.5.
|
|
43
|
-
- @backstage/plugin-
|
|
44
|
-
- @backstage/plugin-catalog-node@1.4.2
|
|
45
|
-
- @backstage/plugin-permission-node@0.7.12
|
|
46
|
-
- @backstage/backend-plugin-api@0.6.1
|
|
36
|
+
- @backstage/plugin-catalog-backend@1.12.2-next.0
|
|
37
|
+
- @backstage/plugin-auth-node@0.3.0-next.0
|
|
38
|
+
- @backstage/backend-common@0.19.4-next.0
|
|
39
|
+
- @backstage/integration@1.7.0-next.0
|
|
40
|
+
- @backstage/backend-tasks@0.5.7-next.0
|
|
41
|
+
- @backstage/backend-plugin-api@0.6.2-next.0
|
|
47
42
|
- @backstage/catalog-client@1.4.3
|
|
48
43
|
- @backstage/catalog-model@1.4.1
|
|
49
44
|
- @backstage/config@1.0.8
|
|
50
45
|
- @backstage/errors@1.2.1
|
|
51
46
|
- @backstage/types@1.1.0
|
|
52
47
|
- @backstage/plugin-catalog-common@1.0.15
|
|
48
|
+
- @backstage/plugin-catalog-node@1.4.3-next.0
|
|
53
49
|
- @backstage/plugin-permission-common@0.7.7
|
|
50
|
+
- @backstage/plugin-permission-node@0.7.13-next.0
|
|
54
51
|
- @backstage/plugin-scaffolder-common@1.4.0
|
|
55
|
-
|
|
56
|
-
## 1.16.1
|
|
57
|
-
|
|
58
|
-
### Patch Changes
|
|
59
|
-
|
|
60
|
-
- 2ba07bcdb046: Fixed the plugin and module ID of the alpha `catalogModuleTemplateKind` export.
|
|
52
|
+
- @backstage/plugin-scaffolder-node@0.2.2-next.0
|
|
61
53
|
|
|
62
54
|
## 1.16.0
|
|
63
55
|
|
package/alpha/package.json
CHANGED
package/dist/alpha.cjs.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
6
6
|
var alpha = require('@backstage/plugin-catalog-node/alpha');
|
|
7
|
-
var ScaffolderEntitiesProcessor = require('./cjs/ScaffolderEntitiesProcessor-
|
|
7
|
+
var ScaffolderEntitiesProcessor = require('./cjs/ScaffolderEntitiesProcessor-96675669.cjs.js');
|
|
8
8
|
var alpha$1 = require('@backstage/plugin-scaffolder-common/alpha');
|
|
9
9
|
var pluginPermissionNode = require('@backstage/plugin-permission-node');
|
|
10
10
|
var backendCommon = require('@backstage/backend-common');
|
|
@@ -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$
|
|
84
|
+
const examples$e = [
|
|
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$
|
|
108
|
+
examples: examples$e,
|
|
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$
|
|
232
|
+
const examples$d = [
|
|
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$
|
|
276
|
+
examples: examples$d,
|
|
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$
|
|
290
|
+
const examples$c = [
|
|
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$
|
|
329
|
+
examples: examples$c,
|
|
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$
|
|
404
|
+
const examples$b = [
|
|
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$
|
|
442
|
+
examples: examples$b,
|
|
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$
|
|
489
|
+
const examples$a = [
|
|
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$
|
|
552
|
+
examples: examples$a,
|
|
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$
|
|
597
|
+
const examples$9 = [
|
|
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$
|
|
636
|
+
examples: examples$9,
|
|
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$
|
|
673
|
+
const examples$8 = [
|
|
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$
|
|
697
|
+
examples: examples$8,
|
|
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$
|
|
965
|
+
const examples$7 = [
|
|
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$
|
|
1001
|
+
examples: examples$7,
|
|
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$
|
|
1206
|
+
const examples$6 = [
|
|
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$
|
|
1228
|
+
examples: examples$6,
|
|
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$
|
|
1265
|
+
const examples$5 = [
|
|
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$
|
|
1291
|
+
examples: examples$5,
|
|
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$4 = [
|
|
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$4,
|
|
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$
|
|
2230
|
+
const examples$3 = [
|
|
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$
|
|
2283
|
+
examples: examples$3,
|
|
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$2 = [
|
|
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$2,
|
|
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
|
|
2950
|
-
|
|
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
|
|
3011
|
+
`No credentials provided ${url}, please check your integrations config`
|
|
2953
3012
|
);
|
|
2954
3013
|
}
|
|
2955
|
-
|
|
2956
|
-
|
|
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
|
|
@@ -4166,11 +4222,63 @@ Change-Id: ${changeId}`;
|
|
|
4166
4222
|
});
|
|
4167
4223
|
}
|
|
4168
4224
|
|
|
4225
|
+
const examples$1 = [
|
|
4226
|
+
{
|
|
4227
|
+
description: "Initializes a git repository of contents in workspace and publish it to GitHub with default configuration.",
|
|
4228
|
+
example: yaml__default["default"].stringify({
|
|
4229
|
+
steps: [
|
|
4230
|
+
{
|
|
4231
|
+
id: "publish",
|
|
4232
|
+
action: "publish:github",
|
|
4233
|
+
name: "Publish to GitHub",
|
|
4234
|
+
input: {
|
|
4235
|
+
repoUrl: "github.com?repo=repo&owner=owner"
|
|
4236
|
+
}
|
|
4237
|
+
}
|
|
4238
|
+
]
|
|
4239
|
+
})
|
|
4240
|
+
},
|
|
4241
|
+
{
|
|
4242
|
+
description: "Add a description.",
|
|
4243
|
+
example: yaml__default["default"].stringify({
|
|
4244
|
+
steps: [
|
|
4245
|
+
{
|
|
4246
|
+
id: "publish",
|
|
4247
|
+
action: "publish:github",
|
|
4248
|
+
name: "Publish to GitHub",
|
|
4249
|
+
input: {
|
|
4250
|
+
repoUrl: "github.com?repo=repo&owner=owner",
|
|
4251
|
+
description: "Initialize a git repository"
|
|
4252
|
+
}
|
|
4253
|
+
}
|
|
4254
|
+
]
|
|
4255
|
+
})
|
|
4256
|
+
},
|
|
4257
|
+
{
|
|
4258
|
+
description: "Change visibility of the repository.",
|
|
4259
|
+
example: yaml__default["default"].stringify({
|
|
4260
|
+
steps: [
|
|
4261
|
+
{
|
|
4262
|
+
id: "publish",
|
|
4263
|
+
action: "publish:github",
|
|
4264
|
+
name: "Publish to GitHub",
|
|
4265
|
+
input: {
|
|
4266
|
+
repoUrl: "github.com?repo=repo&owner=owner",
|
|
4267
|
+
description: "Initialize a git repository",
|
|
4268
|
+
repoVisibility: "public"
|
|
4269
|
+
}
|
|
4270
|
+
}
|
|
4271
|
+
]
|
|
4272
|
+
})
|
|
4273
|
+
}
|
|
4274
|
+
];
|
|
4275
|
+
|
|
4169
4276
|
function createPublishGithubAction(options) {
|
|
4170
4277
|
const { integrations, config, githubCredentialsProvider } = options;
|
|
4171
4278
|
return pluginScaffolderNode.createTemplateAction({
|
|
4172
4279
|
id: "publish:github",
|
|
4173
4280
|
description: "Initializes a git repository of contents in workspace and publishes it to GitHub.",
|
|
4281
|
+
examples: examples$1,
|
|
4174
4282
|
schema: {
|
|
4175
4283
|
input: {
|
|
4176
4284
|
type: "object",
|
|
@@ -4648,11 +4756,63 @@ const createPublishGithubPullRequestAction = (options) => {
|
|
|
4648
4756
|
}
|
|
4649
4757
|
};
|
|
4650
4758
|
|
|
4759
|
+
const examples = [
|
|
4760
|
+
{
|
|
4761
|
+
description: "Initializes a git repository of the content in the workspace, and publishes it to GitLab.",
|
|
4762
|
+
example: yaml__default["default"].stringify({
|
|
4763
|
+
steps: [
|
|
4764
|
+
{
|
|
4765
|
+
id: "publish",
|
|
4766
|
+
action: "publish:gitlab",
|
|
4767
|
+
name: "Publish to GitLab",
|
|
4768
|
+
input: {
|
|
4769
|
+
repoUrl: "gitlab.com?repo=project_name&owner=group_name"
|
|
4770
|
+
}
|
|
4771
|
+
}
|
|
4772
|
+
]
|
|
4773
|
+
})
|
|
4774
|
+
},
|
|
4775
|
+
{
|
|
4776
|
+
description: "Add a description.",
|
|
4777
|
+
example: yaml__default["default"].stringify({
|
|
4778
|
+
steps: [
|
|
4779
|
+
{
|
|
4780
|
+
id: "publish",
|
|
4781
|
+
action: "publish:gitlab",
|
|
4782
|
+
name: "Publish to GitLab",
|
|
4783
|
+
input: {
|
|
4784
|
+
repoUrl: "gitlab.com?repo=project_name&owner=group_name",
|
|
4785
|
+
description: "Initialize a git repository"
|
|
4786
|
+
}
|
|
4787
|
+
}
|
|
4788
|
+
]
|
|
4789
|
+
})
|
|
4790
|
+
},
|
|
4791
|
+
{
|
|
4792
|
+
description: "Sets the commit message on the repository. The default value is `initial commit`.",
|
|
4793
|
+
example: yaml__default["default"].stringify({
|
|
4794
|
+
steps: [
|
|
4795
|
+
{
|
|
4796
|
+
id: "publish",
|
|
4797
|
+
action: "publish:gitlab",
|
|
4798
|
+
name: "Publish to GitLab",
|
|
4799
|
+
input: {
|
|
4800
|
+
repoUrl: "gitlab.com?repo=project_name&owner=group_name",
|
|
4801
|
+
description: "Initialize a git repository",
|
|
4802
|
+
gitCommitMessage: "Started a project."
|
|
4803
|
+
}
|
|
4804
|
+
}
|
|
4805
|
+
]
|
|
4806
|
+
})
|
|
4807
|
+
}
|
|
4808
|
+
];
|
|
4809
|
+
|
|
4651
4810
|
function createPublishGitlabAction(options) {
|
|
4652
4811
|
const { integrations, config } = options;
|
|
4653
4812
|
return pluginScaffolderNode.createTemplateAction({
|
|
4654
4813
|
id: "publish:gitlab",
|
|
4655
4814
|
description: "Initializes a git repository of the content in the workspace, and publishes it to GitLab.",
|
|
4815
|
+
examples,
|
|
4656
4816
|
schema: {
|
|
4657
4817
|
input: {
|
|
4658
4818
|
type: "object",
|
|
@@ -5306,13 +5466,19 @@ class DatabaseTaskStore {
|
|
|
5306
5466
|
}
|
|
5307
5467
|
async listStaleTasks(options) {
|
|
5308
5468
|
const { timeoutS } = options;
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5469
|
+
let heartbeatInterval = this.db.raw(`? - interval '${timeoutS} seconds'`, [
|
|
5470
|
+
this.db.fn.now()
|
|
5471
|
+
]);
|
|
5472
|
+
if (this.db.client.config.client.includes("mysql")) {
|
|
5473
|
+
heartbeatInterval = this.db.raw(
|
|
5474
|
+
`date_sub(now(), interval ${timeoutS} second)`
|
|
5475
|
+
);
|
|
5476
|
+
} else if (this.db.client.config.client.includes("sqlite3")) {
|
|
5477
|
+
heartbeatInterval = this.db.raw(`datetime('now', ?)`, [
|
|
5478
|
+
`-${timeoutS} seconds`
|
|
5479
|
+
]);
|
|
5480
|
+
}
|
|
5481
|
+
const rawRows = await this.db("tasks").where("status", "processing").andWhere("last_heartbeat_at", "<=", heartbeatInterval);
|
|
5316
5482
|
const tasks = rawRows.map((row) => ({
|
|
5317
5483
|
taskId: row.id
|
|
5318
5484
|
}));
|
|
@@ -6995,4 +7161,4 @@ exports.createRouter = createRouter;
|
|
|
6995
7161
|
exports.createWaitAction = createWaitAction;
|
|
6996
7162
|
exports.scaffolderActionRules = scaffolderActionRules;
|
|
6997
7163
|
exports.scaffolderTemplateRules = scaffolderTemplateRules;
|
|
6998
|
-
//# sourceMappingURL=ScaffolderEntitiesProcessor-
|
|
7164
|
+
//# sourceMappingURL=ScaffolderEntitiesProcessor-96675669.cjs.js.map
|