From 3678f855cd4a2d145581afe5b1ae54b3e8158de1 Mon Sep 17 00:00:00 2001 From: Bert De Geyter Date: Mon, 20 May 2024 16:04:45 +0200 Subject: [PATCH] feat: support custom labels on Gitlab Merge Request (#180) Co-authored-by: bert.degeyter --- .changeset/four-ladybugs-teach.md | 5 +++++ README.md | 1 + src/run.ts | 8 ++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .changeset/four-ladybugs-teach.md diff --git a/.changeset/four-ladybugs-teach.md b/.changeset/four-ladybugs-teach.md new file mode 100644 index 00000000..151cb15a --- /dev/null +++ b/.changeset/four-ladybugs-teach.md @@ -0,0 +1,5 @@ +--- +'changesets-gitlab': minor +--- + +Allow adding custom labels to the version package Gitlab Merge Request diff --git a/README.md b/README.md index d8b207ff..eae3d239 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ GitLab CI cli for [changesets](https://github.com/atlassian/changesets) like its - `INPUT_REMOVE_SOURCE_BRANCH` - Enables the merge request "Delete source branch" checkbox. Default false. - `INPUT_TARGET_BRANCH` -> The merge request target branch. Defaults to current branch - `INPUT_CREATE_GITLAB_RELEASES` - A boolean value to indicate whether to create Gitlab releases after publish or not. Default true. +- `INPUT_LABELS` - A comma separated string of labels to be added to the version package Gitlab Merge request ### Outputs diff --git a/src/run.ts b/src/run.ts index f7622dc1..a3522b97 100644 --- a/src/run.ts +++ b/src/run.ts @@ -13,11 +13,12 @@ import * as context from './context.js' import * as gitUtils from './gitUtils.js' import readChangesetState from './readChangesetState.js' import { - getChangelogEntry, execWithOutput, getChangedPackages, - sortTheThings, + getChangelogEntry, + getOptionalInput, getVersionsByDirectory, + sortTheThings, } from './utils.js' import { createApi } from './index.js' @@ -312,6 +313,9 @@ ${ { description: await mrBodyPromise, removeSourceBranch, + labels: getOptionalInput('labels') + ?.split(',') + .map(x => x.trim()), }, ) } else {