Skip to content

Commit

Permalink
feat(release-it-config): update pushRepo URL
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlu-zyl committed Sep 27, 2024
1 parent 1129414 commit 749e5f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/spotty-singers-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@alanlu-dev/release-it-config': patch
---

fix(release-it-config): update pushRepo URL
10 changes: 9 additions & 1 deletion packages/release-it-config/src/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ const packageJson = JSON.parse(packageJsonContent)
const packageName = packageJson.name
const scope = packageName.split('/')[1]

let pushRepo = packageJson.repository.url.replace(/^git\+/, '')
if (!pushRepo.startsWith('https://')) {
pushRepo = pushRepo.replace(/^http:\/\//, 'https://')
}
if (!pushRepo.endsWith('.git')) {
pushRepo += '.git'
}

module.exports = {
plugins: {
'@release-it/conventional-changelog': {
Expand All @@ -48,7 +56,7 @@ module.exports = {
requireBranch: 'main',
push: true,
tagName: `${packageName}@${version}`,
pushRepo: packageJson.repository.url,
pushRepo,
commitsPath: '.',
commitMessage: `chore(${scope}): released version v${version} [skip ci]`,
requireCommits: true,
Expand Down

0 comments on commit 749e5f3

Please sign in to comment.