Skip to content

Commit

Permalink
Add SENTRY_REPOSITORY env variable Allow users to override the respos…
Browse files Browse the repository at this point in the history
…itory name passed to the cli. This is useful for gitlab users where the the repository name is not necessarily the same as the url (getsentry#21)
  • Loading branch information
lewisjared authored and vasyl-semilyak-akidolabs committed Oct 26, 2021
1 parent d42f0b1 commit 28beb8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = {
const sentryRelease = process.env.SENTRY_RELEASE || inputs.sentryRelease || process.env.COMMIT_REF
const releasePrefix = process.env.SENTRY_RELEASE_PREFIX || inputs.releasePrefix || ''
const sentryEnvironment = process.env.SENTRY_ENVIRONMENT || process.env.CONTEXT
const sentryRepository = process.env.SENTRY_REPOSITORY || inputs.sentryRepository
const sourceMapPath = inputs.sourceMapPath || PUBLISH_DIR
const sourceMapUrlPrefix = inputs.sourceMapUrlPrefix || DEFAULT_SOURCE_MAP_URL_PREFIX

Expand Down Expand Up @@ -108,7 +109,7 @@ async function createSentryRelease({ pluginApi, release, sentryEnvironment, sour

// https://docs.sentry.io/cli/releases/#sentry-cli-commit-integration
if (!inputs.skipSetCommits) {
const repository = process.env.REPOSITORY_URL.split(/[:/]/).slice(-2).join('/')
const repository = sentryRepository || process.env.REPOSITORY_URL.split(/[:/]/).slice(-2).join('/')
try {
await cli.releases.setCommits(release, {
repo: repository,
Expand Down

0 comments on commit 28beb8c

Please sign in to comment.