Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(publish): support my-repo@[version] versions #655

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The plugin can be configured in the [**semantic-release** configuration file](ht
| `sourcemaps` | Directory with sourcemaps. Example `dist`. Optional for upload sourcemaps |
| `urlPrefix` | URL prefix for sourcemaps. Example `~/dist`. Optional for upload sourcemaps |
| `rewrite` | Boolean to indicate rewrite sourcemaps. Default `false`. Optional for upload sourcemaps |
| `releasePrefix` | String that is passed as prefix to the sentry release. <br/> Optional to fix the problem that releases are associated with the organization instead of the project ([Read More](https://github.com/getsentry/sentry-cli/issues/482)). <br/> Ex: `releasePrefix:"web1"` would resolve **only** the sentry release to `web1-1.0.0`. <br/>**Important Notice:** when you use this feature you also have to change the release name in your sentry client app. |
| `releasePrefix` | String that is passed as prefix to the sentry release. <br/> Optional to fix the problem that releases are associated with the organization instead of the project ([Read More](https://github.com/getsentry/sentry-cli/issues/482)). <br/> Ex: `releasePrefix:"web1"` would resolve **only** the sentry release to `web1@1.0.0`. <br/>**Important Notice:** when you use this feature you also have to change the release name in your sentry client app. |

| `pathToGitFolder` | Path to `.git` folder, relative to the current working directory. Optional. Defaults to current working directory |

Expand Down
2 changes: 1 addition & 1 deletion src/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module.exports = async (pluginConfig, ctx) => {
const commits = await parseCommits(pluginConfig, ctx)
ctx.logger.log('Commit data retrieved')
const sentryReleaseVersion = pluginConfig.releasePrefix
? `${pluginConfig.releasePrefix}-${ctx.nextRelease.version}`
? `${pluginConfig.releasePrefix}@${ctx.nextRelease.version}`
: ctx.nextRelease.version
/** @type {SentryReleaseParams} */
const releaseDate = {
Expand Down
6 changes: 3 additions & 3 deletions test/publish.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ describe('Publish', () => {
},
],
ref: '6ba09a7c53235ee8a8fa5ee4c1ca8ca886e7fdbb',
shortVersion: 'web1-1.0.0',
shortVersion: 'web1@1.0.0',
url: null,
version: 'web1-1.0.0',
version: 'web1@1.0.0',
})
.post('/api/0/organizations/valid/releases/web1-1.0.0/deploys/')
.reply(201, {
Expand Down Expand Up @@ -255,7 +255,7 @@ describe('Publish', () => {
ctx,
)
expect(result.release.version).to.equal(
`${releasePrefix}-${ctx.nextRelease.version}`,
`${releasePrefix}@${ctx.nextRelease.version}`,
)
})

Expand Down