Skip to content
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
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ The plugin can be configured in the [**semantic-release** configuration file](ht

### Options

| Variable | Description |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `project` | The slug of the project. Optional. Required if not present in environment variables |
| `org` | The slug of the organization. Optional. Required if not present in environment variables |
| `url` | The URL to use to connect to sentry. Optional to set an on-premise instance |
| `repositoryUrl` | A valid repository name for add link to commits of new release in **sentry format**. Optional. Ex: 'myorg / myapp'. Default repository property in package.json, or git origin url. Try recovery repository name from sentry api https://docs.sentry.io/api/organizations/list-an-organizations-repositories/ |
| `tagsUrl` | A valid url for add link to new release. Optional. Ex: https://github.com/owner/repo/releases/tag/vx.y.z |
| `environment` | Sentry environment. Optional for deploy. Default production |
| `deployName` | Deploy name. Optional for deploy |
| `deployUrl` | Deploy url. Optional for deploy |
| `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. |

| `pathToGitFolder` | Path to `.git` folder, relative to the current working directory. Optional. Defaults to current working directory |
| Variable | Description |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `project` | The slug of the project. Optional. Required if not present in environment variables |
| `org` | The slug of the organization. Optional. Required if not present in environment variables |
| `url` | The URL to use to connect to sentry. Optional to set an on-premise instance |
| `repositoryUrl` | A valid repository name for add link to commits of new release in **sentry format**. Optional. Ex: 'myorg / myapp'. Default repository property in package.json, or git origin url. Try recovery repository name from sentry api https://docs.sentry.io/api/organizations/list-an-organizations-repositories/ |
| `tagsUrl` | A valid url for add link to new release. Optional. Ex: https://github.com/owner/repo/releases/tag/vx.y.z |
| `environment` | Sentry environment. Optional for deploy. Default production |
| `deployName` | Deploy name. Optional for deploy |
| `deployUrl` | Deploy url. Optional for deploy |
| `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. |
| `releasePrefixSeparator` | The string which separates the releasePrefix and the release version. By default it is '-', resulting in release names prefix-1.2.3. You might want this to be @ sign so that the versions will be correctly assigned to projects in the Sentry UI. Ex: `[email protected]` |
| `pathToGitFolder` | Path to `.git` folder, relative to the current working directory. Optional. Defaults to current working directory |

### Examples

Expand Down
3 changes: 2 additions & 1 deletion src/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = async (pluginConfig, ctx) => {
const project = ctx.env.SENTRY_PROJECT || pluginConfig.project
const org = ctx.env.SENTRY_ORG || pluginConfig.org
const url = ctx.env.SENTRY_URL || pluginConfig.url || 'https://sentry.io/'
const releasePrefixSeparator = pluginConfig.releasePrefixSeparator || '-'
ctx.logger.log('Retrieving repository name')
pluginConfig.repositoryUrl = await getRepositoryName(
ctx.env.SENTRY_AUTH_TOKEN,
Expand All @@ -69,7 +70,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}${releasePrefixSeparator}${ctx.nextRelease.version}`
: ctx.nextRelease.version
/** @type {SentryReleaseParams} */
const releaseDate = {
Expand Down
1 change: 1 addition & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface Config {
urlPrefix?: string
rewrite?: boolean
releasePrefix?: string
releasePrefixSeparator?: string
pathToGitFolder?: string
}

Expand Down