diff --git a/.changeset/light-cows-bow.md b/.changeset/light-cows-bow.md new file mode 100644 index 0000000000..231a4245c3 --- /dev/null +++ b/.changeset/light-cows-bow.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': minor +--- + +Clearer error messages for action publish:gitlab:merge-request diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlabMergeRequest.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlabMergeRequest.ts index 06e056cda3..84a17024d1 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlabMergeRequest.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/gitlabMergeRequest.ts @@ -218,14 +218,16 @@ export const createPublishGitlabMergeRequestAction = (options: { try { await api.Branches.create(repoID, branchName, String(defaultBranch)); } catch (e) { - throw new InputError(`The branch creation failed ${e}`); + throw new InputError( + `The branch creation failed. Please check that your repo does not already contain a branch named '${branchName}'. ${e}`, + ); } try { await api.Commits.create(repoID, branchName, ctx.input.title, actions); } catch (e) { throw new InputError( - `Committing the changes to ${branchName} failed ${e}`, + `Committing the changes to ${branchName} failed. Please check that none of the files created by the template already exists. ${e}`, ); }