Skip to content

Commit

Permalink
Add some debug logging
Browse files Browse the repository at this point in the history
Attempting to fix semantic-release#192
  • Loading branch information
Nathan Friend committed Dec 18, 2020
1 parent 2664d70 commit 00eae24
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions lib/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

1 comment on commit 00eae24

@EvanCarroll
Copy link

Choose a reason for hiding this comment

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

I wish you'd get this commited under the --debug option.

Please sign in to comment.