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);