Skip to content

fix(pipeline): Add name parameter to avoid 400 error #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ module.exports = async (pluginConfig, context) => {
const json = {
/* eslint-disable camelcase */
tag_name: gitTag,
name: `Bump tag: ${gitTag}`,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name could optionally be resolved by the plugin config so that:

  • if it is defined, the given value is set
  • if it is not defined, this value is assigned by default
    like:
name: pluginConfig.name || `Bump tag: ${gitTag}`,

description: notes && notes.trim() ? notes : gitTag,
milestones,
assets: {
Expand Down
7 changes: 7 additions & 0 deletions test/publish.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ test.serial('Publish a release', async t => {
const gitlab = authenticate(env)
.post(`/projects/${encodedRepoId}/releases`, {
tag_name: nextRelease.gitTag,
name: `Bump tag: ${nextRelease.gitTag}`,
description: nextRelease.notes,
assets: {
links: [],
Expand Down Expand Up @@ -59,6 +60,7 @@ test.serial('Publish a release with assets', async t => {
const gitlab = authenticate(env)
.post(`/projects/${encodedRepoId}/releases`, {
tag_name: nextRelease.gitTag,
name: `Bump tag: ${nextRelease.gitTag}`,
description: nextRelease.notes,
assets: {
links: [
Expand Down Expand Up @@ -103,6 +105,7 @@ test.serial('Publish a release with asset type and permalink', async t => {
const gitlab = authenticate(env)
.post(`/projects/${encodedRepoId}/releases`, {
tag_name: nextRelease.gitTag,
name: `Bump tag: ${nextRelease.gitTag}`,
description: nextRelease.notes,
assets: {
links: [
Expand Down Expand Up @@ -141,6 +144,7 @@ test.serial('Publish a release with a milestone', async t => {
const gitlab = authenticate(env)
.post(`/projects/${encodedRepoId}/releases`, {
tag_name: nextRelease.gitTag,
name: `Bump tag: ${nextRelease.gitTag}`,
description: nextRelease.notes,
assets: {
links: [],
Expand Down Expand Up @@ -170,6 +174,7 @@ test.serial('Publish a release with array of missing assets', async t => {
const gitlab = authenticate(env)
.post(`/projects/${encodedRepoId}/releases`, {
tag_name: nextRelease.gitTag,
name: `Bump tag: ${nextRelease.gitTag}`,
description: nextRelease.notes,
assets: {
links: [],
Expand Down Expand Up @@ -198,6 +203,7 @@ test.serial('Publish a release with one asset and custom label', async t => {
const gitlab = authenticate(env)
.post(`/projects/${encodedRepoId}/releases`, {
tag_name: nextRelease.gitTag,
name: `Bump tag: ${nextRelease.gitTag}`,
description: nextRelease.notes,
assets: {
links: [
Expand Down Expand Up @@ -234,6 +240,7 @@ test.serial('Publish a release with missing release notes', async t => {
const gitlab = authenticate(env)
.post(`/projects/${encodedRepoId}/releases`, {
tag_name: nextRelease.gitTag,
name: `Bump tag: ${nextRelease.gitTag}`,
description: nextRelease.gitTag,
assets: {
links: [],
Expand Down