Skip to content

Commit b22a7f3

Browse files
author
Nathan Friend
authored
fix: update release URL returned from publish.js (#185)
1 parent 2664d70 commit b22a7f3

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

lib/publish.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,5 @@ module.exports = async (pluginConfig, context) => {
8888

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

91-
return {url: urlJoin(gitlabUrl, encodedRepoId, `/tags/${encodedGitTag}`), name: 'GitLab release'};
91+
return {url: urlJoin(gitlabUrl, encodedRepoId, `/-/releases/${encodedGitTag}`), name: 'GitLab release'};
9292
};

test/integration.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ test.serial('Publish a release', async t => {
7676

7777
const result = await t.context.m.publish({}, {env, nextRelease, options, logger: t.context.logger});
7878

79-
t.is(result.url, `https://gitlab.com/${encodedRepoId}/tags/${nextRelease.gitTag}`);
79+
t.is(result.url, `https://gitlab.com/${encodedRepoId}/-/releases/${nextRelease.gitTag}`);
8080
t.deepEqual(t.context.log.args[0], ['Verify GitLab authentication (%s)', 'https://gitlab.com/api/v4']);
8181
t.deepEqual(t.context.log.args[1], ['Published GitLab release: %s', nextRelease.gitTag]);
8282
t.true(gitlab.isDone());
@@ -105,7 +105,7 @@ test.serial('Verify Github auth and release', async t => {
105105
await t.notThrowsAsync(t.context.m.verifyConditions({}, {env, options, logger: t.context.logger}));
106106
const result = await t.context.m.publish({}, {env, options, nextRelease, logger: t.context.logger});
107107

108-
t.is(result.url, `https://gitlab.com/${encodedRepoId}/tags/${nextRelease.gitTag}`);
108+
t.is(result.url, `https://gitlab.com/${encodedRepoId}/-/releases/${nextRelease.gitTag}`);
109109
t.deepEqual(t.context.log.args[0], ['Verify GitLab authentication (%s)', 'https://gitlab.com/api/v4']);
110110
t.deepEqual(t.context.log.args[1], ['Published GitLab release: %s', nextRelease.gitTag]);
111111
t.true(gitlab.isDone());

test/publish.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ test.serial('Publish a release', async t => {
4040

4141
const result = await publish(pluginConfig, {env, options, nextRelease, logger: t.context.logger});
4242

43-
t.is(result.url, `https://gitlab.com/${encodedRepoId}/tags/${encodedGitTag}`);
43+
t.is(result.url, `https://gitlab.com/${encodedRepoId}/-/releases/${encodedGitTag}`);
4444
t.deepEqual(t.context.log.args[0], ['Published GitLab release: %s', nextRelease.gitTag]);
4545
t.true(gitlab.isDone());
4646
});
@@ -76,7 +76,7 @@ test.serial('Publish a release with assets', async t => {
7676

7777
const result = await publish({assets}, {env, cwd, options, nextRelease, logger: t.context.logger});
7878

79-
t.is(result.url, `https://gitlab.com/${encodedRepoId}/tags/${encodedGitTag}`);
79+
t.is(result.url, `https://gitlab.com/${encodedRepoId}/-/releases/${encodedGitTag}`);
8080
t.deepEqual(t.context.log.args[0], ['Uploaded file: %s', uploaded.url]);
8181
t.deepEqual(t.context.log.args[1], ['Published GitLab release: %s', nextRelease.gitTag]);
8282
t.true(gitlabUpload.isDone());
@@ -105,7 +105,7 @@ test.serial('Publish a release with array of missing assets', async t => {
105105
.reply(200);
106106
const result = await publish({assets}, {env, cwd, options, nextRelease, logger: t.context.logger});
107107

108-
t.is(result.url, `https://gitlab.com/${encodedRepoId}/tags/${encodedGitTag}`);
108+
t.is(result.url, `https://gitlab.com/${encodedRepoId}/-/releases/${encodedGitTag}`);
109109
t.deepEqual(t.context.log.args[0], ['Published GitLab release: %s', nextRelease.gitTag]);
110110
t.true(gitlab.isDone());
111111
});
@@ -142,7 +142,7 @@ test.serial('Publish a release with one asset and custom label', async t => {
142142

143143
const result = await publish({assets}, {env, cwd, options, nextRelease, logger: t.context.logger});
144144

145-
t.is(result.url, `https://gitlab.com/${encodedRepoId}/tags/${encodedGitTag}`);
145+
t.is(result.url, `https://gitlab.com/${encodedRepoId}/-/releases/${encodedGitTag}`);
146146
t.deepEqual(t.context.log.args[0], ['Uploaded file: %s', uploaded.url]);
147147
t.deepEqual(t.context.log.args[1], ['Published GitLab release: %s', nextRelease.gitTag]);
148148
t.true(gitlabUpload.isDone());
@@ -170,7 +170,7 @@ test.serial('Publish a release with missing release notes', async t => {
170170

171171
const result = await publish(pluginConfig, {env, options, nextRelease, logger: t.context.logger});
172172

173-
t.is(result.url, `https://gitlab.com/${encodedRepoId}/tags/${encodedGitTag}`);
173+
t.is(result.url, `https://gitlab.com/${encodedRepoId}/-/releases/${encodedGitTag}`);
174174
t.deepEqual(t.context.log.args[0], ['Published GitLab release: %s', nextRelease.gitTag]);
175175
t.true(gitlab.isDone());
176176
});

0 commit comments

Comments
 (0)