From 19da7d132fcd74b10c9fef5c66d015be4a6dc213 Mon Sep 17 00:00:00 2001 From: Robert Oroszi Date: Thu, 17 Jun 2021 10:40:05 +0200 Subject: [PATCH] refactor(gitlab): use the releases api instead of deprecated tags api Creating release on `repository/tags` endpoint has been deprecated and marked for removal on gitlab. This causes non-zero exit codes, therefore, breaking automatic CI pipelines. Fixes #204 BREAKING CHANGE: in Gitlab 14 the release notes creation via tags api is removed. It can be done with releases api, the minimum Gitlab version changed to 11.11. Signed-off-by: Robert Oroszi --- packages/conventional-gitlab-releaser/README.md | 2 +- packages/conventional-gitlab-releaser/src/index.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/conventional-gitlab-releaser/README.md b/packages/conventional-gitlab-releaser/README.md index 3f4ceb81..2f3f7cf0 100644 --- a/packages/conventional-gitlab-releaser/README.md +++ b/packages/conventional-gitlab-releaser/README.md @@ -92,7 +92,7 @@ Please use this [gist](https://gist.github.com/stevemao/280ef22ee861323993a0) to ### Required GitLab CE/EE Edition -Version [9.0](https://about.gitlab.com/2017/03/22/gitlab-9-0-released/#api-v4-ce-ees-eep), or higher, of GitLab CE/EE is required for `conventional-gitlab-releaser`. +Version [11.11](https://about.gitlab.com/releases/2019/05/22/gitlab-11-11-released), or higher, of GitLab CE/EE is required for `conventional-gitlab-releaser`. Core features used: * [GitLab release page](http://docs.gitlab.com/ce/workflow/releases.html) diff --git a/packages/conventional-gitlab-releaser/src/index.js b/packages/conventional-gitlab-releaser/src/index.js index 19059569..7d70244b 100644 --- a/packages/conventional-gitlab-releaser/src/index.js +++ b/packages/conventional-gitlab-releaser/src/index.js @@ -73,14 +73,14 @@ function conventionalGitlabReleaser (auth, changelogOpts, context, gitRawCommits return } - const url = `projects/${escape(context.owner + `/` + context.repository)}/repository/tags` + const url = `projects/${escape(context.owner + `/` + context.repository)}/releases` const options = { endpoint: auth.url, body: { tag_name: chunk.keyCommit.version, ref: chunk.keyCommit.hash, - message: 'Release ' + chunk.keyCommit.version, - release_description: chunk.log + name: chunk.keyCommit.version, + description: chunk.log } } debug(`posting %o to the following URL - ${url}`, options)