@backstage/plugin-scaffolder-backend 0.15.22 → 0.15.23-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 +9 -0
- package/dist/index.cjs.js +12 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-backend
|
|
2
2
|
|
|
3
|
+
## 0.15.23-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2e0dbb0e50: Migrate from deprecated package @octokit/rest to octokit
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/plugin-catalog-backend@0.21.2-next.0
|
|
10
|
+
- @backstage/plugin-scaffolder-backend-module-cookiecutter@0.1.10-next.0
|
|
11
|
+
|
|
3
12
|
## 0.15.22
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -17,7 +17,7 @@ var child_process = require('child_process');
|
|
|
17
17
|
var stream = require('stream');
|
|
18
18
|
var azureDevopsNodeApi = require('azure-devops-node-api');
|
|
19
19
|
var fetch = require('node-fetch');
|
|
20
|
-
var
|
|
20
|
+
var octokit = require('octokit');
|
|
21
21
|
var lodash = require('lodash');
|
|
22
22
|
var octokitPluginCreatePullRequest = require('octokit-plugin-create-pull-request');
|
|
23
23
|
var node = require('@gitbeaker/node');
|
|
@@ -741,7 +741,7 @@ const enableBranchProtectionOnDefaultRepoBranch = async ({
|
|
|
741
741
|
}) => {
|
|
742
742
|
const tryOnce = async () => {
|
|
743
743
|
try {
|
|
744
|
-
await client.repos.updateBranchProtection({
|
|
744
|
+
await client.rest.repos.updateBranchProtection({
|
|
745
745
|
mediaType: {
|
|
746
746
|
previews: ["luke-cage-preview"]
|
|
747
747
|
},
|
|
@@ -1188,7 +1188,7 @@ class OctokitProvider {
|
|
|
1188
1188
|
if (!token) {
|
|
1189
1189
|
throw new errors.InputError(`No token available for host: ${host}, with owner ${owner}, and repo ${repo}`);
|
|
1190
1190
|
}
|
|
1191
|
-
const client = new
|
|
1191
|
+
const client = new octokit.Octokit({
|
|
1192
1192
|
auth: token,
|
|
1193
1193
|
baseUrl: integrationConfig.apiBaseUrl,
|
|
1194
1194
|
previews: ["nebula-preview"]
|
|
@@ -1295,16 +1295,16 @@ function createPublishGithubAction(options) {
|
|
|
1295
1295
|
topics
|
|
1296
1296
|
} = ctx.input;
|
|
1297
1297
|
const { client, token, owner, repo } = await octokitProvider.getOctokit(repoUrl);
|
|
1298
|
-
const user = await client.users.getByUsername({
|
|
1298
|
+
const user = await client.rest.users.getByUsername({
|
|
1299
1299
|
username: owner
|
|
1300
1300
|
});
|
|
1301
|
-
const repoCreationPromise = user.data.type === "Organization" ? client.repos.createInOrg({
|
|
1301
|
+
const repoCreationPromise = user.data.type === "Organization" ? client.rest.repos.createInOrg({
|
|
1302
1302
|
name: repo,
|
|
1303
1303
|
org: owner,
|
|
1304
1304
|
private: repoVisibility === "private",
|
|
1305
1305
|
visibility: repoVisibility,
|
|
1306
1306
|
description
|
|
1307
|
-
}) : client.repos.createForAuthenticatedUser({
|
|
1307
|
+
}) : client.rest.repos.createForAuthenticatedUser({
|
|
1308
1308
|
name: repo,
|
|
1309
1309
|
private: repoVisibility === "private",
|
|
1310
1310
|
description
|
|
@@ -1312,7 +1312,7 @@ function createPublishGithubAction(options) {
|
|
|
1312
1312
|
const { data: newRepo } = await repoCreationPromise;
|
|
1313
1313
|
if (access == null ? void 0 : access.startsWith(`${owner}/`)) {
|
|
1314
1314
|
const [, team] = access.split("/");
|
|
1315
|
-
await client.teams.addOrUpdateRepoPermissionsInOrg({
|
|
1315
|
+
await client.rest.teams.addOrUpdateRepoPermissionsInOrg({
|
|
1316
1316
|
org: owner,
|
|
1317
1317
|
team_slug: team,
|
|
1318
1318
|
owner,
|
|
@@ -1320,7 +1320,7 @@ function createPublishGithubAction(options) {
|
|
|
1320
1320
|
permission: "admin"
|
|
1321
1321
|
});
|
|
1322
1322
|
} else if (access && access !== owner) {
|
|
1323
|
-
await client.repos.addCollaborator({
|
|
1323
|
+
await client.rest.repos.addCollaborator({
|
|
1324
1324
|
owner,
|
|
1325
1325
|
repo,
|
|
1326
1326
|
username: access,
|
|
@@ -1333,7 +1333,7 @@ function createPublishGithubAction(options) {
|
|
|
1333
1333
|
username: team_slug
|
|
1334
1334
|
} of collaborators) {
|
|
1335
1335
|
try {
|
|
1336
|
-
await client.teams.addOrUpdateRepoPermissionsInOrg({
|
|
1336
|
+
await client.rest.teams.addOrUpdateRepoPermissionsInOrg({
|
|
1337
1337
|
org: owner,
|
|
1338
1338
|
team_slug,
|
|
1339
1339
|
owner,
|
|
@@ -1348,7 +1348,7 @@ function createPublishGithubAction(options) {
|
|
|
1348
1348
|
}
|
|
1349
1349
|
if (topics) {
|
|
1350
1350
|
try {
|
|
1351
|
-
await client.repos.replaceAllTopics({
|
|
1351
|
+
await client.rest.repos.replaceAllTopics({
|
|
1352
1352
|
owner,
|
|
1353
1353
|
repo,
|
|
1354
1354
|
names: topics.map((t) => t.toLowerCase())
|
|
@@ -1416,7 +1416,7 @@ const defaultClientFactory = async ({
|
|
|
1416
1416
|
if (!token) {
|
|
1417
1417
|
throw new errors.InputError(`No token available for host: ${host}, with owner ${owner}, and repo ${repo}`);
|
|
1418
1418
|
}
|
|
1419
|
-
const OctokitPR =
|
|
1419
|
+
const OctokitPR = octokit.Octokit.plugin(octokitPluginCreatePullRequest.createPullRequest);
|
|
1420
1420
|
return new OctokitPR({
|
|
1421
1421
|
auth: token,
|
|
1422
1422
|
baseUrl: integrationConfig.apiBaseUrl
|
|
@@ -1887,7 +1887,7 @@ function createGithubWebhookAction(options) {
|
|
|
1887
1887
|
const { client, owner, repo } = await octokitProvider.getOctokit(repoUrl);
|
|
1888
1888
|
try {
|
|
1889
1889
|
const insecure_ssl = insecureSsl ? "1" : "0";
|
|
1890
|
-
await client.repos.createWebhook({
|
|
1890
|
+
await client.rest.repos.createWebhook({
|
|
1891
1891
|
owner,
|
|
1892
1892
|
repo,
|
|
1893
1893
|
config: {
|