Skip to content

Commit 00eae24

Browse files
author
Nathan Friend
committed
Add some debug logging
Attempting to fix semantic-release#192
1 parent 2664d70 commit 00eae24

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

lib/publish.js

+20-14
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,28 @@ module.exports = async (pluginConfig, context) => {
6868
}
6969

7070
debug('Create a release for git tag %o with commit %o', gitTag, gitHead);
71+
72+
const json = {
73+
/* eslint-disable camelcase */
74+
tag_name: gitTag,
75+
description: notes && notes.trim() ? notes : gitTag,
76+
assets: {
77+
links: assetsList.map(({label, alt, url}) => {
78+
return {
79+
name: label || alt,
80+
url: urlJoin(gitlabUrl, repoId, url),
81+
};
82+
}),
83+
},
84+
/* eslint-enable camelcase */
85+
};
86+
87+
logger.log('About to POST the following JSON to /releases:');
88+
logger.log(JSON.stringify(json, null, 2));
89+
7190
await got.post(urlJoin(gitlabApiUrl, `/projects/${encodedRepoId}/releases`), {
7291
...apiOptions,
73-
json: {
74-
/* eslint-disable camelcase */
75-
tag_name: gitTag,
76-
description: notes && notes.trim() ? notes : gitTag,
77-
assets: {
78-
links: assetsList.map(({label, alt, url}) => {
79-
return {
80-
name: label || alt,
81-
url: urlJoin(gitlabUrl, repoId, url),
82-
};
83-
}),
84-
},
85-
/* eslint-enable camelcase */
86-
},
92+
json,
8793
});
8894

8995
logger.log('Published GitLab release: %s', gitTag);

0 commit comments

Comments
 (0)