From 0e48aaf690620b5c74f15ea038db530cce8b482b Mon Sep 17 00:00:00 2001 From: mbruhin <47482924+mbruhin@users.noreply.github.com> Date: Tue, 12 Mar 2024 13:54:22 -0600 Subject: [PATCH 1/3] add ability to specify author name and email for bitbucket commits Signed-off-by: mbruhin <47482924+mbruhin@users.noreply.github.com> --- .changeset/fair-fishes-marry.md | 5 +++++ .../src/actions/bitbucketServerPullRequest.ts | 22 +++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 .changeset/fair-fishes-marry.md diff --git a/.changeset/fair-fishes-marry.md b/.changeset/fair-fishes-marry.md new file mode 100644 index 0000000000..8f315f0fcb --- /dev/null +++ b/.changeset/fair-fishes-marry.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend-module-bitbucket-server': patch +--- + +Added an option to specify a commit author by adding gitAuthorName and gitAuthorEmail options to the `publish:bitbucketServer:pull-request` action diff --git a/plugins/scaffolder-backend-module-bitbucket-server/src/actions/bitbucketServerPullRequest.ts b/plugins/scaffolder-backend-module-bitbucket-server/src/actions/bitbucketServerPullRequest.ts index fc123f0b80..80412ca413 100644 --- a/plugins/scaffolder-backend-module-bitbucket-server/src/actions/bitbucketServerPullRequest.ts +++ b/plugins/scaffolder-backend-module-bitbucket-server/src/actions/bitbucketServerPullRequest.ts @@ -220,6 +220,8 @@ export function createPublishBitbucketServerPullRequestAction(options: { targetBranch?: string; sourceBranch: string; token?: string; + gitAuthorName?: string; + gitAuthorEmail?: string; }>({ id: 'publish:bitbucketServer:pull-request', schema: { @@ -257,6 +259,16 @@ export function createPublishBitbucketServerPullRequestAction(options: { description: 'The token to use for authorization to BitBucket Server', }, + gitAuthorName: { + title: 'Author Name', + type: 'string', + description: `Sets the author name for the commit. The default value is 'Scaffolder'`, + }, + gitAuthorEmail: { + title: 'Author Email', + type: 'string', + description: `Sets the author email for the commit.`, + }, }, }, output: { @@ -276,6 +288,8 @@ export function createPublishBitbucketServerPullRequestAction(options: { description, targetBranch = 'master', sourceBranch, + gitAuthorName, + gitAuthorEmail, } = ctx.input; const { project, repo, host } = parseRepoUrl(repoUrl, integrations); @@ -354,8 +368,12 @@ export function createPublishBitbucketServerPullRequestAction(options: { }; const gitAuthorInfo = { - name: config.getOptionalString('scaffolder.defaultAuthor.name'), - email: config.getOptionalString('scaffolder.defaultAuthor.email'), + name: + gitAuthorName || + config.getOptionalString('scaffolder.defaultAuthor.name'), + email: + gitAuthorEmail || + config.getOptionalString('scaffolder.defaultAuthor.email'), }; const tempDir = await ctx.createTemporaryDirectory(); From 224c59d707733e3b507d57ceef14f619e9a381ec Mon Sep 17 00:00:00 2001 From: mbruhin <47482924+mbruhin@users.noreply.github.com> Date: Wed, 13 Mar 2024 13:13:28 -0600 Subject: [PATCH 2/3] update API report Signed-off-by: mbruhin <47482924+mbruhin@users.noreply.github.com> --- .../scaffolder-backend-module-bitbucket-server/api-report.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/scaffolder-backend-module-bitbucket-server/api-report.md b/plugins/scaffolder-backend-module-bitbucket-server/api-report.md index 3e2e3dffe4..4d75a3dbda 100644 --- a/plugins/scaffolder-backend-module-bitbucket-server/api-report.md +++ b/plugins/scaffolder-backend-module-bitbucket-server/api-report.md @@ -45,6 +45,8 @@ export function createPublishBitbucketServerPullRequestAction(options: { targetBranch?: string | undefined; sourceBranch: string; token?: string | undefined; + gitAuthorName?: string | undefined; + gitAuthorEmail?: string | undefined; }, JsonObject >; From 7937d3b886eb6c1d8df20fa38e1edefe84f7b97b Mon Sep 17 00:00:00 2001 From: Ben Lambert Date: Tue, 19 Mar 2024 13:33:52 +0100 Subject: [PATCH 3/3] Update fair-fishes-marry.md Signed-off-by: Ben Lambert --- .changeset/fair-fishes-marry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/fair-fishes-marry.md b/.changeset/fair-fishes-marry.md index 8f315f0fcb..92fa45fc53 100644 --- a/.changeset/fair-fishes-marry.md +++ b/.changeset/fair-fishes-marry.md @@ -2,4 +2,4 @@ '@backstage/plugin-scaffolder-backend-module-bitbucket-server': patch --- -Added an option to specify a commit author by adding gitAuthorName and gitAuthorEmail options to the `publish:bitbucketServer:pull-request` action +Added an option to specify a commit author by adding `gitAuthorName` and `gitAuthorEmail` options to the `publish:bitbucketServer:pull-request` action