From 00eae24417cbb140cd25058ee26305fe85dac7bd Mon Sep 17 00:00:00 2001 From: Nathan Friend Date: Fri, 18 Dec 2020 12:37:27 -0500 Subject: [PATCH] Add some debug logging Attempting to fix https://github.com/semantic-release/gitlab/issues/192 --- lib/publish.js | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/lib/publish.js b/lib/publish.js index 97c0c5ec..98bf75a5 100644 --- a/lib/publish.js +++ b/lib/publish.js @@ -68,22 +68,28 @@ module.exports = async (pluginConfig, context) => { } debug('Create a release for git tag %o with commit %o', gitTag, gitHead); + + const json = { + /* eslint-disable camelcase */ + tag_name: gitTag, + description: notes && notes.trim() ? notes : gitTag, + assets: { + links: assetsList.map(({label, alt, url}) => { + return { + name: label || alt, + url: urlJoin(gitlabUrl, repoId, url), + }; + }), + }, + /* eslint-enable camelcase */ + }; + + logger.log('About to POST the following JSON to /releases:'); + logger.log(JSON.stringify(json, null, 2)); + await got.post(urlJoin(gitlabApiUrl, `/projects/${encodedRepoId}/releases`), { ...apiOptions, - json: { - /* eslint-disable camelcase */ - tag_name: gitTag, - description: notes && notes.trim() ? notes : gitTag, - assets: { - links: assetsList.map(({label, alt, url}) => { - return { - name: label || alt, - url: urlJoin(gitlabUrl, repoId, url), - }; - }), - }, - /* eslint-enable camelcase */ - }, + json, }); logger.log('Published GitLab release: %s', gitTag);