@backstage/plugin-scaffolder-backend 1.0.1-next.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # @backstage/plugin-scaffolder-backend
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2a7d52ca2c: Override default commit message and author details in GitLab action
8
+ - f5f921dafb: Add new `draft` option to the `publish:github:pull-request` action.
9
+
10
+ ### Patch Changes
11
+
12
+ - 64d9a031a8: build(deps): bump `isbinaryfile` from 4.0.8 to 5.0.0
13
+ - 2f3d3a1eae: build(deps): bump `@gitbeaker/core` from 34.6.0 to 35.6.0
14
+ - Updated dependencies
15
+ - @backstage/plugin-catalog-backend@1.1.0
16
+ - @backstage/integration@1.1.0
17
+ - @backstage/catalog-model@1.0.1
18
+ - @backstage/backend-common@0.13.2
19
+ - @backstage/catalog-client@1.0.1
20
+ - @backstage/plugin-scaffolder-common@1.0.1
21
+
22
+ ## 1.1.0-next.2
23
+
24
+ ### Patch Changes
25
+
26
+ - 64d9a031a8: build(deps): bump `isbinaryfile` from 4.0.8 to 5.0.0
27
+ - 2f3d3a1eae: build(deps): bump `@gitbeaker/core` from 34.6.0 to 35.6.0
28
+ - Updated dependencies
29
+ - @backstage/plugin-catalog-backend@1.1.0-next.2
30
+ - @backstage/catalog-model@1.0.1-next.1
31
+
32
+ ## 1.1.0-next.1
33
+
34
+ ### Minor Changes
35
+
36
+ - 2a7d52ca2c: Override default commit message and author details in GitLab action
37
+ - f5f921dafb: Add new `draft` option to the `publish:github:pull-request` action.
38
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies
42
+ - @backstage/plugin-catalog-backend@1.1.0-next.1
43
+ - @backstage/integration@1.1.0-next.1
44
+ - @backstage/backend-common@0.13.2-next.1
45
+
3
46
  ## 1.0.1-next.0
4
47
 
5
48
  ### Patch Changes
package/README.md CHANGED
@@ -21,8 +21,7 @@ restoring the plugin, if you previously removed it.
21
21
 
22
22
  ```bash
23
23
  # From your Backstage root directory
24
- cd packages/backend
25
- yarn add @backstage/plugin-scaffolder-backend
24
+ yarn add --cwd packages/backend @backstage/plugin-scaffolder-backend
26
25
  ```
27
26
 
28
27
  ### Adding the plugin to your `packages/backend`
package/dist/index.cjs.js CHANGED
@@ -1528,6 +1528,11 @@ const createPublishGithubPullRequestAction = ({
1528
1528
  title: "Pull Request Description",
1529
1529
  description: "The description of the pull request"
1530
1530
  },
1531
+ draft: {
1532
+ type: "boolean",
1533
+ title: "Create as Draft",
1534
+ description: "Create a draft pull request"
1535
+ },
1531
1536
  sourcePath: {
1532
1537
  type: "string",
1533
1538
  title: "Working Subdirectory",
@@ -1568,6 +1573,7 @@ const createPublishGithubPullRequestAction = ({
1568
1573
  branchName,
1569
1574
  title,
1570
1575
  description,
1576
+ draft,
1571
1577
  targetPath,
1572
1578
  sourcePath,
1573
1579
  token: providedToken
@@ -1618,7 +1624,8 @@ const createPublishGithubPullRequestAction = ({
1618
1624
  title,
1619
1625
  changes,
1620
1626
  body: description,
1621
- head: branchName
1627
+ head: branchName,
1628
+ draft
1622
1629
  });
1623
1630
  if (!response) {
1624
1631
  throw new GithubResponseError("null response from Github");
@@ -1656,6 +1663,21 @@ function createPublishGitlabAction(options) {
1656
1663
  type: "string",
1657
1664
  description: `Sets the default branch on the repository. The default value is 'master'`
1658
1665
  },
1666
+ gitCommitMessage: {
1667
+ title: "Git Commit Message",
1668
+ type: "string",
1669
+ description: `Sets the commit message on the repository. The default value is 'initial commit'`
1670
+ },
1671
+ gitAuthorName: {
1672
+ title: "Default Author Name",
1673
+ type: "string",
1674
+ description: `Sets the default author name for the commit. The default value is 'Scaffolder'`
1675
+ },
1676
+ gitAuthorEmail: {
1677
+ title: "Default Author Email",
1678
+ type: "string",
1679
+ description: `Sets the default author email for the commit.`
1680
+ },
1659
1681
  sourcePath: {
1660
1682
  title: "Source Path",
1661
1683
  description: "Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.",
@@ -1686,7 +1708,10 @@ function createPublishGitlabAction(options) {
1686
1708
  const {
1687
1709
  repoUrl,
1688
1710
  repoVisibility = "private",
1689
- defaultBranch = "master"
1711
+ defaultBranch = "master",
1712
+ gitCommitMessage = "initial commit",
1713
+ gitAuthorName,
1714
+ gitAuthorEmail
1690
1715
  } = ctx.input;
1691
1716
  const { owner, repo, host } = parseRepoUrl(repoUrl, integrations);
1692
1717
  if (!owner) {
@@ -1718,8 +1743,8 @@ function createPublishGitlabAction(options) {
1718
1743
  const remoteUrl = http_url_to_repo.replace(/\.git$/, "");
1719
1744
  const repoContentsUrl = `${remoteUrl}/-/blob/${defaultBranch}`;
1720
1745
  const gitAuthorInfo = {
1721
- name: config.getOptionalString("scaffolder.defaultAuthor.name"),
1722
- email: config.getOptionalString("scaffolder.defaultAuthor.email")
1746
+ name: gitAuthorName ? gitAuthorName : config.getOptionalString("scaffolder.defaultAuthor.name"),
1747
+ email: gitAuthorEmail ? gitAuthorEmail : config.getOptionalString("scaffolder.defaultAuthor.email")
1723
1748
  };
1724
1749
  await initRepoAndPush({
1725
1750
  dir: getRepoSourceDirectory(ctx.workspacePath, ctx.input.sourcePath),
@@ -1730,7 +1755,7 @@ function createPublishGitlabAction(options) {
1730
1755
  password: token
1731
1756
  },
1732
1757
  logger: ctx.logger,
1733
- commitMessage: config.getOptionalString("scaffolder.defaultCommitMessage"),
1758
+ commitMessage: gitCommitMessage ? gitCommitMessage : config.getOptionalString("scaffolder.defaultCommitMessage"),
1734
1759
  gitAuthorInfo
1735
1760
  });
1736
1761
  ctx.output("remoteUrl", remoteUrl);