Skip to content

Commit 8a32927

Browse files
committed
Fix cli release script
1 parent a089696 commit 8a32927

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/release.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { dirname, join } from 'path'
1313
const __filename = fileURLToPath(import.meta.url)
1414
const __dirname = dirname(__filename)
1515
const ROOT_DIR = join(__dirname, '..')
16+
const GITHUB_REPO = 'usetrmnl/trmnl-home-assistant'
1617

1718
// File paths
1819
const PATHS = {
@@ -210,8 +211,7 @@ function updateChangelog(newVersion, previousVersion, entries) {
210211
const rest = content.slice(headerEnd)
211212

212213
// Update comparison links at the bottom
213-
const repoUrl = 'https://github.com/usetrmnl/trmnl-home-assistant'
214-
const newLink = `[${newVersion}]: ${repoUrl}/compare/v${previousVersion}...v${newVersion}`
214+
const newLink = `[${newVersion}]: https://github.com/${GITHUB_REPO}/compare/v${previousVersion}...v${newVersion}`
215215

216216
// Find where links section starts (after ---)
217217
const linksStart = rest.lastIndexOf('\n[')
@@ -340,7 +340,7 @@ function release(bumpType, options = {}) {
340340

341341
try {
342342
execSync(
343-
`gh release create v${newVersion} --title "v${newVersion}" --notes "${releaseNotes.replace(
343+
`gh release create v${newVersion} --title "v${newVersion}" -R ${GITHUB_REPO} --notes "${releaseNotes.replace(
344344
/"/g,
345345
'\\"'
346346
)}"`,
@@ -356,12 +356,14 @@ function release(bumpType, options = {}) {
356356
'⚠️ Failed to create GitHub release. Create manually with:'
357357
)
358358
console.log(
359-
` gh release create v${newVersion} --title "v${newVersion}"`
359+
` gh release create v${newVersion} --title "v${newVersion}" -R ${GITHUB_REPO}`
360360
)
361361
}
362362
} else {
363363
console.log(`\n💡 To push: git push && git push origin v${newVersion}`)
364-
console.log(`💡 Then create release: gh release create v${newVersion}`)
364+
console.log(
365+
`💡 Then create release: gh release create v${newVersion} -R ${GITHUB_REPO}`
366+
)
365367
}
366368

367369
console.log(`\n🎉 Release ${newVersion} complete!\n`)

0 commit comments

Comments
 (0)