diff --git a/plugins/scaffolder-backend-module-gitlab/package.json b/plugins/scaffolder-backend-module-gitlab/package.json index d67aefbd27..da7ee27c83 100644 --- a/plugins/scaffolder-backend-module-gitlab/package.json +++ b/plugins/scaffolder-backend-module-gitlab/package.json @@ -37,7 +37,7 @@ "@backstage/integration": "workspace:^", "@backstage/plugin-scaffolder-node": "workspace:^", "@gitbeaker/core": "^35.8.0", - "@gitbeaker/node": "^35.1.0", + "@gitbeaker/node": "^35.8.0", "yaml": "^2.0.0", "zod": "^3.21.4" }, diff --git a/plugins/scaffolder-node/src/actions/gitHelpers.ts b/plugins/scaffolder-node/src/actions/gitHelpers.ts index 770440dba3..6d449a0a29 100644 --- a/plugins/scaffolder-node/src/actions/gitHelpers.ts +++ b/plugins/scaffolder-node/src/actions/gitHelpers.ts @@ -20,15 +20,7 @@ import { Logger } from 'winston'; /** * @public */ -export async function initRepoAndPush({ - dir, - remoteUrl, - auth, - logger, - defaultBranch = 'master', - commitMessage = 'Initial commit', - gitAuthorInfo, -}: { +export async function initRepoAndPush(input: { dir: string; remoteUrl: string; // For use cases where token has to be used with Basic Auth @@ -40,6 +32,15 @@ export async function initRepoAndPush({ commitMessage?: string; gitAuthorInfo?: { name?: string; email?: string }; }): Promise<{ commitHash: string }> { + const { + dir, + remoteUrl, + auth, + logger, + defaultBranch = 'master', + commitMessage = 'Initial commit', + gitAuthorInfo, + } = input; const git = Git.fromAuth({ ...auth, logger, @@ -81,15 +82,7 @@ export async function initRepoAndPush({ /** * @public */ -export async function commitAndPushRepo({ - dir, - auth, - logger, - commitMessage, - gitAuthorInfo, - branch = 'master', - remoteRef, -}: { +export async function commitAndPushRepo(input: { dir: string; // For use cases where token has to be used with Basic Auth // it has to be provided as password together with a username @@ -101,6 +94,16 @@ export async function commitAndPushRepo({ branch?: string; remoteRef?: string; }): Promise<{ commitHash: string }> { + const { + dir, + auth, + logger, + commitMessage, + gitAuthorInfo, + branch = 'master', + remoteRef, + } = input; + const git = Git.fromAuth({ ...auth, logger, diff --git a/yarn.lock b/yarn.lock index f302329de7..c370053903 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8741,7 +8741,7 @@ __metadata: "@backstage/integration": "workspace:^" "@backstage/plugin-scaffolder-node": "workspace:^" "@gitbeaker/core": ^35.8.0 - "@gitbeaker/node": ^35.1.0 + "@gitbeaker/node": ^35.8.0 yaml: ^2.0.0 zod: ^3.21.4 languageName: unknown @@ -11631,7 +11631,7 @@ __metadata: languageName: node linkType: hard -"@gitbeaker/node@npm:^35.1.0": +"@gitbeaker/node@npm:^35.1.0, @gitbeaker/node@npm:^35.8.0": version: 35.8.1 resolution: "@gitbeaker/node@npm:35.8.1" dependencies: