@backstage/plugin-scaffolder-backend-module-github 0.8.1-next.2 → 0.8.2-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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # @backstage/plugin-scaffolder-backend-module-github
2
2
 
3
+ ## 0.8.2-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/plugin-scaffolder-node@0.11.0-next.0
9
+ - @backstage/plugin-catalog-node@1.18.0-next.0
10
+ - @backstage/backend-plugin-api@1.4.2-next.0
11
+ - @backstage/catalog-model@1.7.5
12
+ - @backstage/config@1.3.3
13
+ - @backstage/errors@1.2.7
14
+ - @backstage/integration@1.17.1
15
+ - @backstage/types@1.2.1
16
+
17
+ ## 0.8.1
18
+
19
+ ### Patch Changes
20
+
21
+ - f36bcf9: Added support for file deletion to `publish:github:pull-request` action.
22
+
23
+ Example usage:
24
+
25
+ ```diff
26
+ - action: publish:github:pull-request
27
+ id: clean-up-pr
28
+ input:
29
+ description: This is the description
30
+ + filesToDelete:
31
+ + - outdated/changelog.md
32
+ + - sample-file.txt
33
+ owner: owner
34
+ repo: repo
35
+ title: Title Goes Here
36
+
37
+ ```
38
+
39
+ - 38db3eb: Fix typo in `InputError`
40
+ - Updated dependencies
41
+ - @backstage/config@1.3.3
42
+ - @backstage/catalog-model@1.7.5
43
+ - @backstage/plugin-scaffolder-node@0.10.0
44
+ - @backstage/integration@1.17.1
45
+ - @backstage/backend-plugin-api@1.4.1
46
+ - @backstage/plugin-catalog-node@1.17.2
47
+
3
48
  ## 0.8.1-next.2
4
49
 
5
50
  ### Patch Changes
package/dist/util.cjs.js CHANGED
@@ -26,7 +26,7 @@ async function getOctokitOptions(options) {
26
26
  }
27
27
  if (!owner || !repo) {
28
28
  throw new errors.InputError(
29
- `No owner and/or owner provided, which is required if a token is not provided`
29
+ `No owner and/or repo provided, which is required if a token is not provided`
30
30
  );
31
31
  }
32
32
  const githubCredentialsProvider = credentialsProvider ?? integration.DefaultGithubCredentialsProvider.fromIntegrations(integrations);
@@ -1 +1 @@
1
- {"version":3,"file":"util.cjs.js","sources":["../src/util.ts"],"sourcesContent":["/*\n * Copyright 2025 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 */\n\nimport { InputError } from '@backstage/errors';\nimport {\n DefaultGithubCredentialsProvider,\n GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport { parseRepoUrl } from '@backstage/plugin-scaffolder-node';\nimport { OctokitOptions } from '@octokit/core/dist-types/types';\n\nconst DEFAULT_TIMEOUT_MS = 60_000;\n\n/**\n * Helper for generating octokit configuration options.\n * If no token is provided, it will attempt to get a token from the credentials provider.\n * @public\n */\nexport async function getOctokitOptions(options: {\n integrations: ScmIntegrationRegistry;\n credentialsProvider?: GithubCredentialsProvider;\n token?: string;\n host: string;\n owner?: string;\n repo?: string;\n}): Promise<OctokitOptions>;\n\n/**\n * Helper for generating octokit configuration options for given repoUrl.\n * If no token is provided, it will attempt to get a token from the credentials provider.\n * @public\n * @deprecated Use options `host`, `owner` and `repo` instead of `repoUrl`.\n */\nexport async function getOctokitOptions(options: {\n integrations: ScmIntegrationRegistry;\n credentialsProvider?: GithubCredentialsProvider;\n token?: string;\n repoUrl: string;\n}): Promise<OctokitOptions>;\n\nexport async function getOctokitOptions(options: {\n integrations: ScmIntegrationRegistry;\n credentialsProvider?: GithubCredentialsProvider;\n token?: string;\n host?: string;\n owner?: string;\n repo?: string;\n repoUrl?: string;\n}): Promise<OctokitOptions> {\n const { integrations, credentialsProvider, token, repoUrl } = options;\n const { host, owner, repo } = repoUrl\n ? parseRepoUrl(repoUrl, integrations)\n : options;\n\n const requestOptions = {\n // set timeout to 60 seconds\n timeout: DEFAULT_TIMEOUT_MS,\n };\n\n const integrationConfig = integrations.github.byHost(host!)?.config;\n\n if (!integrationConfig) {\n throw new InputError(`No integration for host ${host}`);\n }\n\n // short circuit the `githubCredentialsProvider` if there is a token provided by the caller already\n if (token) {\n return {\n auth: token,\n baseUrl: integrationConfig.apiBaseUrl,\n previews: ['nebula-preview'],\n request: requestOptions,\n };\n }\n\n if (!owner || !repo) {\n throw new InputError(\n `No owner and/or owner provided, which is required if a token is not provided`,\n );\n }\n\n const githubCredentialsProvider =\n credentialsProvider ??\n DefaultGithubCredentialsProvider.fromIntegrations(integrations);\n\n const { token: credentialProviderToken } =\n await githubCredentialsProvider.getCredentials({\n url: `https://${host}/${encodeURIComponent(owner)}/${encodeURIComponent(\n repo,\n )}`,\n });\n\n if (!credentialProviderToken) {\n throw new InputError(\n `No token available for host: ${host}, with owner ${owner}, and repo ${repo}. Make sure GitHub auth is configured correctly. See https://backstage.io/docs/auth/github/provider for more details.`,\n );\n }\n\n return {\n auth: credentialProviderToken,\n baseUrl: integrationConfig.apiBaseUrl,\n previews: ['nebula-preview'],\n };\n}\n"],"names":["parseRepoUrl","InputError","DefaultGithubCredentialsProvider"],"mappings":";;;;;;AAyBA,MAAM,kBAAqB,GAAA,GAAA;AA6B3B,eAAsB,kBAAkB,OAQZ,EAAA;AAC1B,EAAA,MAAM,EAAE,YAAA,EAAc,mBAAqB,EAAA,KAAA,EAAO,SAAY,GAAA,OAAA;AAC9D,EAAM,MAAA,EAAE,MAAM,KAAO,EAAA,IAAA,KAAS,OAC1B,GAAAA,iCAAA,CAAa,OAAS,EAAA,YAAY,CAClC,GAAA,OAAA;AAEJ,EAAA,MAAM,cAAiB,GAAA;AAAA;AAAA,IAErB,OAAS,EAAA;AAAA,GACX;AAEA,EAAA,MAAM,iBAAoB,GA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 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 */\n\nimport { InputError } from '@backstage/errors';\nimport {\n DefaultGithubCredentialsProvider,\n GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport { parseRepoUrl } from '@backstage/plugin-scaffolder-node';\nimport { OctokitOptions } from '@octokit/core/dist-types/types';\n\nconst DEFAULT_TIMEOUT_MS = 60_000;\n\n/**\n * Helper for generating octokit configuration options.\n * If no token is provided, it will attempt to get a token from the credentials provider.\n * @public\n */\nexport async function getOctokitOptions(options: {\n integrations: ScmIntegrationRegistry;\n credentialsProvider?: GithubCredentialsProvider;\n token?: string;\n host: string;\n owner?: string;\n repo?: string;\n}): Promise<OctokitOptions>;\n\n/**\n * Helper for generating octokit configuration options for given repoUrl.\n * If no token is provided, it will attempt to get a token from the credentials provider.\n * @public\n * @deprecated Use options `host`, `owner` and `repo` instead of `repoUrl`.\n */\nexport async function getOctokitOptions(options: {\n integrations: ScmIntegrationRegistry;\n credentialsProvider?: GithubCredentialsProvider;\n token?: string;\n repoUrl: string;\n}): Promise<OctokitOptions>;\n\nexport async function getOctokitOptions(options: {\n integrations: ScmIntegrationRegistry;\n credentialsProvider?: GithubCredentialsProvider;\n token?: string;\n host?: string;\n owner?: string;\n repo?: string;\n repoUrl?: string;\n}): Promise<OctokitOptions> {\n const { integrations, credentialsProvider, token, repoUrl } = options;\n const { host, owner, repo } = repoUrl\n ? parseRepoUrl(repoUrl, integrations)\n : options;\n\n const requestOptions = {\n // set timeout to 60 seconds\n timeout: DEFAULT_TIMEOUT_MS,\n };\n\n const integrationConfig = integrations.github.byHost(host!)?.config;\n\n if (!integrationConfig) {\n throw new InputError(`No integration for host ${host}`);\n }\n\n // short circuit the `githubCredentialsProvider` if there is a token provided by the caller already\n if (token) {\n return {\n auth: token,\n baseUrl: integrationConfig.apiBaseUrl,\n previews: ['nebula-preview'],\n request: requestOptions,\n };\n }\n\n if (!owner || !repo) {\n throw new InputError(\n `No owner and/or repo provided, which is required if a token is not provided`,\n );\n }\n\n const githubCredentialsProvider =\n credentialsProvider ??\n DefaultGithubCredentialsProvider.fromIntegrations(integrations);\n\n const { token: credentialProviderToken } =\n await githubCredentialsProvider.getCredentials({\n url: `https://${host}/${encodeURIComponent(owner)}/${encodeURIComponent(\n repo,\n )}`,\n });\n\n if (!credentialProviderToken) {\n throw new InputError(\n `No token available for host: ${host}, with owner ${owner}, and repo ${repo}. Make sure GitHub auth is configured correctly. See https://backstage.io/docs/auth/github/provider for more details.`,\n );\n }\n\n return {\n auth: credentialProviderToken,\n baseUrl: integrationConfig.apiBaseUrl,\n previews: ['nebula-preview'],\n };\n}\n"],"names":["parseRepoUrl","InputError","DefaultGithubCredentialsProvider"],"mappings":";;;;;;AAyBA,MAAM,kBAAqB,GAAA,GAAA;AA6B3B,eAAsB,kBAAkB,OAQZ,EAAA;AAC1B,EAAA,MAAM,EAAE,YAAA,EAAc,mBAAqB,EAAA,KAAA,EAAO,SAAY,GAAA,OAAA;AAC9D,EAAM,MAAA,EAAE,MAAM,KAAO,EAAA,IAAA,KAAS,OAC1B,GAAAA,iCAAA,CAAa,OAAS,EAAA,YAAY,CAClC,GAAA,OAAA;AAEJ,EAAA,MAAM,cAAiB,GAAA;AAAA;AAAA,IAErB,OAAS,EAAA;AAAA,GACX;AAEA,EAAA,MAAM,iBAAoB,GAAA,YAAA,CAAa,MAAO,CAAA,MAAA,CAAO,IAAK,CAAG,EAAA,MAAA;AAE7D,EAAA,IAAI,CAAC,iBAAmB,EAAA;AACtB,IAAA,MAAM,IAAIC,iBAAA,CAAW,CAA2B,wBAAA,EAAA,IAAI,CAAE,CAAA,CAAA;AAAA;AAIxD,EAAA,IAAI,KAAO,EAAA;AACT,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,KAAA;AAAA,MACN,SAAS,iBAAkB,CAAA,UAAA;AAAA,MAC3B,QAAA,EAAU,CAAC,gBAAgB,CAAA;AAAA,MAC3B,OAAS,EAAA;AAAA,KACX;AAAA;AAGF,EAAI,IAAA,CAAC,KAAS,IAAA,CAAC,IAAM,EAAA;AACnB,IAAA,MAAM,IAAIA,iBAAA;AAAA,MACR,CAAA,2EAAA;AAAA,KACF;AAAA;AAGF,EAAA,MAAM,yBACJ,GAAA,mBAAA,IACAC,4CAAiC,CAAA,gBAAA,CAAiB,YAAY,CAAA;AAEhE,EAAA,MAAM,EAAE,KAAO,EAAA,uBAAA,EACb,GAAA,MAAM,0BAA0B,cAAe,CAAA;AAAA,IAC7C,KAAK,CAAW,QAAA,EAAA,IAAI,IAAI,kBAAmB,CAAA,KAAK,CAAC,CAAI,CAAA,EAAA,kBAAA;AAAA,MACnD;AAAA,KACD,CAAA;AAAA,GACF,CAAA;AAEH,EAAA,IAAI,CAAC,uBAAyB,EAAA;AAC5B,IAAA,MAAM,IAAID,iBAAA;AAAA,MACR,CAAgC,6BAAA,EAAA,IAAI,CAAgB,aAAA,EAAA,KAAK,cAAc,IAAI,CAAA,qHAAA;AAAA,KAC7E;AAAA;AAGF,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,uBAAA;AAAA,IACN,SAAS,iBAAkB,CAAA,UAAA;AAAA,IAC3B,QAAA,EAAU,CAAC,gBAAgB;AAAA,GAC7B;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend-module-github",
3
- "version": "0.8.1-next.2",
3
+ "version": "0.8.2-next.0",
4
4
  "description": "The github module for @backstage/plugin-scaffolder-backend",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -50,13 +50,13 @@
50
50
  "test": "backstage-cli package test"
51
51
  },
52
52
  "dependencies": {
53
- "@backstage/backend-plugin-api": "1.4.1-next.0",
54
- "@backstage/catalog-model": "1.7.5-next.0",
55
- "@backstage/config": "1.3.3-next.0",
53
+ "@backstage/backend-plugin-api": "1.4.2-next.0",
54
+ "@backstage/catalog-model": "1.7.5",
55
+ "@backstage/config": "1.3.3",
56
56
  "@backstage/errors": "1.2.7",
57
- "@backstage/integration": "1.17.1-next.1",
58
- "@backstage/plugin-catalog-node": "1.17.2-next.0",
59
- "@backstage/plugin-scaffolder-node": "0.10.0-next.2",
57
+ "@backstage/integration": "1.17.1",
58
+ "@backstage/plugin-catalog-node": "1.18.0-next.0",
59
+ "@backstage/plugin-scaffolder-node": "0.11.0-next.0",
60
60
  "@backstage/types": "1.2.1",
61
61
  "@octokit/webhooks": "^10.9.2",
62
62
  "libsodium-wrappers": "^0.7.11",
@@ -66,9 +66,9 @@
66
66
  "zod": "^3.22.4"
67
67
  },
68
68
  "devDependencies": {
69
- "@backstage/backend-test-utils": "1.7.0-next.1",
70
- "@backstage/cli": "0.33.1-next.2",
71
- "@backstage/plugin-scaffolder-node-test-utils": "0.3.1-next.2",
69
+ "@backstage/backend-test-utils": "1.7.1-next.0",
70
+ "@backstage/cli": "0.33.2-next.0",
71
+ "@backstage/plugin-scaffolder-node-test-utils": "0.3.2-next.0",
72
72
  "@types/libsodium-wrappers": "^0.7.10",
73
73
  "fs-extra": "^11.2.0",
74
74
  "jsonschema": "^1.2.6"